/* LeadDATA — marketing UI. Self-hosted only (CSP: 'self'). */

/* ---------------------------------------------------------------- font */
@font-face {
  font-family: "Anuphan";
  font-style: normal;
  font-display: swap;
  font-weight: 100 700;
  src: url("../fonts/anuphan-thai-wght-normal.woff2") format("woff2-variations"), url("../fonts/anuphan-thai-wght-normal.woff2") format("woff2");
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: "Anuphan";
  font-style: normal;
  font-display: swap;
  font-weight: 100 700;
  src: url("../fonts/anuphan-latin-wght-normal.woff2") format("woff2-variations"), url("../fonts/anuphan-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* -------------------------------------------------------------- tokens */
:root {
  --bg: #f6f5fb;
  --surface: #ffffff;
  --surface-2: #faf9fe;
  --ink: #1e1838;
  --ink-2: #3b3557;
  --muted: #625d7a;
  --line: #ebe8f3;
  --line-2: #dcd7ea;

  --brand: #6d28d9;
  --brand-mid: #a21caf;
  --brand-2: #be185d;
  --brand-soft: #f3efff;
  --brand-soft-2: #fdf2f8;
  --grad: linear-gradient(135deg, #6d28d9 0%, #a21caf 55%, #be185d 100%);
  --grad-soft: linear-gradient(135deg, #f3efff 0%, #fbeefa 55%, #fdf0f5 100%);

  --ready: #047857;     --ready-bg: #d1fae5;
  --reserved: #a1480a;  --reserved-bg: #fef3c7;
  --sent: #6d28d9;      --sent-bg: #ede9fe;
  --off: #475569;       --off-bg: #eef1f5;
  --ok: #15803d;        --ok-bg: #dcfce7;
  --bad: #be123c;       --bad-bg: #ffe4e6;
  --follow: #0369a1;    --follow-bg: #e0f2fe;
  --blocked: #c2410c;   --blocked-bg: #ffedd5;
  --danger: #b91c1c;    --danger-bg: #fee2e2;
  --warn: #a1480a;      --warn-bg: #fff4dc;
  --info: #1d4ed8;      --info-bg: #e8efff;

  --r-sm: 8px; --r: 12px; --r-lg: 18px; --r-xl: 24px;
  --sh-1: 0 1px 2px rgba(30, 24, 56, .05), 0 1px 3px rgba(30, 24, 56, .04);
  --sh-2: 0 6px 16px rgba(30, 24, 56, .07), 0 2px 4px rgba(30, 24, 56, .04);
  --sh-3: 0 18px 40px rgba(30, 24, 56, .14), 0 4px 10px rgba(30, 24, 56, .06);
  --sh-brand: 0 8px 22px rgba(124, 58, 237, .30);

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in: cubic-bezier(.55, 0, 1, .45);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --t-fast: 150ms; --t: 240ms; --t-slow: 420ms;

  --sidebar-w: 256px;
  --font: "Anuphan", "Leelawadee UI", "Noto Sans Thai", "Sarabun", Tahoma, system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 650; letter-spacing: -.005em; }
p { margin: 0; }
code { background: var(--brand-soft); color: var(--brand); padding: .05em .4em; border-radius: 6px; font-size: .92em; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: #e9dcff; }
:focus-visible { outline: 3px solid #a78bfa; outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--ink); color: #fff; padding: .55rem 1rem; border-radius: var(--r-sm); }
.skip-link:focus { left: 8px; }
.muted { color: var(--muted); }
.num, .mono, .tabular { font-variant-numeric: tabular-nums; }
.mono { letter-spacing: .02em; font-weight: 550; }
.hint { color: var(--muted); font-size: .875rem; }
.req { color: var(--bad); }
.grow { flex: 1; }
.nowrap { white-space: nowrap; }

.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 26px; height: 26px; }

/* ------------------------------------------------------------- layout */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 1rem;
  padding: 1.25rem .9rem 1rem; background: var(--surface); border-right: 1px solid var(--line); z-index: 40;
}
.brand { display: flex; align-items: center; gap: .65rem; padding: .1rem .45rem; font-weight: 700; font-size: 1.2rem; color: var(--ink); text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: var(--grad);
  box-shadow: var(--sh-brand); font-weight: 800; font-size: 1.05rem; position: relative; overflow: hidden;
}
.brand-mark::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%); transform: translateX(-120%); animation: shine 3.6s var(--ease-out) 1s infinite; }
.brand small { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); letter-spacing: .02em; }
.nav-cta { justify-content: center; width: 100%; }
.nav { display: grid; gap: .2rem; margin: 0; padding: 0; list-style: none; }
.nav-label { font-size: .72rem; font-weight: 600; color: var(--muted); letter-spacing: .06em; padding: .6rem .7rem .2rem; }
.nav a {
  position: relative; display: flex; align-items: center; gap: .75rem; padding: .62rem .75rem; border-radius: var(--r);
  color: var(--ink-2); text-decoration: none; font-weight: 500; transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.nav a .ic { color: var(--muted); transition: color var(--t-fast), transform var(--t) var(--ease-spring); }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a:hover .ic { transform: scale(1.12); color: var(--brand); }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.nav a.active .ic { color: var(--brand); }
.nav a.active::before { content: ""; position: absolute; left: -.9rem; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: var(--grad); animation: grow-y var(--t) var(--ease-out); }
.nav .count { margin-left: auto; min-width: 1.5rem; padding: 0 .4rem; border-radius: 99px; background: var(--grad); color: #fff; font-size: .72rem; font-weight: 700; text-align: center; line-height: 1.4rem; animation: pop var(--t-slow) var(--ease-spring); }
.sidebar-foot { margin-top: auto; display: grid; gap: .6rem; }
.tip-card { background: var(--grad-soft); border: 1px solid #ece3fb; border-radius: var(--r); padding: .8rem .9rem; font-size: .82rem; color: var(--ink-2); }
.tip-card strong { display: flex; align-items: center; gap: .4rem; color: var(--brand); font-size: .85rem; margin-bottom: .2rem; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .9rem; padding: .9rem 2rem;
  background: rgba(246, 245, 251, .82); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent; transition: border-color var(--t), box-shadow var(--t);
}
.topbar.scrolled { border-bottom-color: var(--line); box-shadow: 0 4px 18px rgba(30, 24, 56, .05); }
.page-title { font-size: 1.45rem; font-weight: 700; }
.page-sub { color: var(--muted); font-size: .9rem; }
.topbar-actions { margin-left: auto; display: flex; gap: .6rem; align-items: center; }
.nav-toggle, .scrim { display: none; }
.content { width: 100%; max-width: 1320px; padding: .5rem 2rem 6rem; display: grid; gap: 1.4rem; align-content: start; }

/* ------------------------------------------------------------ buttons */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px;
  padding: .55rem 1.1rem; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: .95rem; line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap; overflow: hidden;
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t) var(--ease-out), background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: #c8bfe0; box-shadow: var(--sh-1); }
.btn:active { transform: scale(.97); }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--sh-brand); }
.btn-primary:hover { border-color: transparent; box-shadow: 0 12px 28px rgba(124, 58, 237, .38); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0) scale(.97); }
.btn-primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%); transform: translateX(-120%); pointer-events: none; }
.btn-primary:hover::after { transform: translateX(120%); transition: transform 700ms var(--ease-out); }
.btn-soft { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.btn-soft:hover { background: #ebe3ff; border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(30, 24, 56, .05); border-color: transparent; box-shadow: none; }
.btn-danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn-danger:hover { background: #991b1b; border-color: transparent; }
.btn-danger-ghost { background: transparent; border-color: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-bg); border-color: transparent; box-shadow: none; }
.btn-sm { min-height: 36px; padding: .35rem .8rem; font-size: .875rem; border-radius: 10px; }
.btn-lg { min-height: 52px; padding: .75rem 1.5rem; font-size: 1.02rem; border-radius: 14px; }
.btn-icon { width: 44px; padding: 0; }
.btn-block { width: 100%; }
.btn.busy { color: transparent !important; pointer-events: none; }
.btn.busy::before {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-color: rgba(109, 40, 217, .25); border-top-color: var(--brand);
  animation: spin .7s linear infinite;
}
.btn-primary.busy::before, .btn-danger.busy::before { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* -------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 1.35rem 1.4rem; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.card-title { font-size: 1.08rem; font-weight: 700; display: flex; align-items: center; gap: .55rem; }
.card-title .ic { color: var(--brand); }
.card-sub { color: var(--muted); font-size: .875rem; margin-top: .15rem; }
.card-hover { transition: transform var(--t) var(--ease-out), box-shadow var(--t) var(--ease-out), border-color var(--t); }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: #e2dcf2; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
.grid-3-1 { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.stack { display: grid; gap: 1rem; }
.row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

/* ----------------------------------------------------------- entrance */
.reveal { animation: fade-up var(--t-slow) var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 60ms); }
.content > .reveal:nth-child(1) { --i: 0; } .content > .reveal:nth-child(2) { --i: 1; } .content > .reveal:nth-child(3) { --i: 2; }
.content > .reveal:nth-child(4) { --i: 3; } .content > .reveal:nth-child(5) { --i: 4; } .content > .reveal:nth-child(6) { --i: 5; }
.stagger > * { animation: fade-up var(--t-slow) var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 45ms + 80ms); }

/* -------------------------------------------------------------- stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.stat { position: relative; overflow: hidden; display: grid; gap: .35rem; padding: 1.15rem 1.2rem; }
.stat-top { display: flex; align-items: center; gap: .65rem; color: var(--muted); font-size: .9rem; font-weight: 600; }
.stat-value { font-size: 2.05rem; font-weight: 750; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat-foot { font-size: .8rem; color: var(--muted); }
.stat::after { content: ""; position: absolute; right: -28px; top: -28px; width: 96px; height: 96px; border-radius: 50%; background: currentColor; opacity: .06; color: var(--tone, var(--brand)); }
.tile { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--tone-bg, var(--brand-soft)); color: var(--tone, var(--brand)); flex: none; }
.tone-brand { --tone: var(--brand); --tone-bg: var(--brand-soft); }
.tone-ready { --tone: var(--ready); --tone-bg: var(--ready-bg); }
.tone-reserved { --tone: var(--reserved); --tone-bg: var(--reserved-bg); }
.tone-sent { --tone: var(--sent); --tone-bg: var(--sent-bg); }
.tone-ok { --tone: var(--ok); --tone-bg: var(--ok-bg); }
.tone-pink { --tone: var(--brand-2); --tone-bg: var(--brand-soft-2); }
.tone-danger { --tone: var(--danger); --tone-bg: var(--danger-bg); }

/* ------------------------------------------------------ badges, chips */
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .62rem; border-radius: 99px; font-size: .8rem; font-weight: 650; white-space: nowrap; background: var(--off-bg); color: var(--off); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-ready { background: var(--ready-bg); color: var(--ready); }
.badge-reserved, .badge-prepared { background: var(--reserved-bg); color: var(--reserved); }
.badge-sent { background: var(--sent-bg); color: var(--sent); }
.badge-cancelled, .badge-inactive { background: var(--off-bg); color: var(--off); }
.badge-active { background: var(--ready-bg); color: var(--ready); }
.badge-interested { background: var(--ok-bg); color: var(--ok); }
.badge-not_interested { background: var(--bad-bg); color: var(--bad); }
.badge-unreachable { background: var(--off-bg); color: var(--off); }
.badge-follow_up { background: var(--follow-bg); color: var(--follow); }
.badge-blocked { background: var(--blocked-bg); color: var(--blocked); }
.badge-pending { background: #f3f2f7; color: #5f5a74; }
.badge-prepared::before { animation: blink 1.6s ease-in-out infinite; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .6rem; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: .8rem; color: var(--ink-2); white-space: nowrap; }
.dot { display: inline-block; vertical-align: .05em; width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--c, var(--brand)); }

/* -------------------------------------------------------------- forms */
.field { display: grid; gap: .4rem; min-width: 0; }
.field > span, .field-label { font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), .field select, .field textarea {
  width: 100%; min-height: 46px; padding: .6rem .85rem; border-radius: var(--r); border: 1.5px solid var(--line-2); background: var(--surface);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast); font-size: 1rem;
}
.field textarea { min-height: 150px; resize: vertical; font-variant-numeric: tabular-nums; line-height: 1.7; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #c6bddd; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(124, 58, 237, .14); }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--bad); box-shadow: 0 0 0 4px rgba(190, 18, 60, .1); animation: shake 320ms var(--ease-out); }
.invalid .input, .invalid .count-input { border-color: var(--bad) !important; box-shadow: 0 0 0 4px rgba(190, 18, 60, .1); animation: shake 320ms var(--ease-out); }
.field-error { color: var(--bad); font-size: .85rem; font-weight: 600; display: flex; align-items: center; gap: .3rem; }
.field-error:empty { display: none; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--brand); cursor: pointer; }
.search { position: relative; }
.search .ic { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 2.6rem !important; }

/* segmented control */
.seg { display: inline-flex; gap: .2rem; padding: .25rem; background: #eeebf6; border-radius: 14px; flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent; padding: .45rem .95rem; border-radius: 10px; font-weight: 600; font-size: .9rem; color: var(--ink-2);
  cursor: pointer; min-height: 38px; transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t);
  display: inline-flex; align-items: center; gap: .4rem;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed=true] { background: var(--surface); color: var(--brand); box-shadow: var(--sh-1); }
.seg .n { font-size: .75rem; padding: 0 .4rem; border-radius: 99px; background: rgba(30, 24, 56, .07); font-variant-numeric: tabular-nums; }
.seg button[aria-pressed=true] .n { background: var(--brand-soft); }

/* pick chips (toggle buttons) */
.picks { display: flex; flex-wrap: wrap; gap: .55rem; }
.pick {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 42px; padding: .4rem .95rem; border-radius: 99px; border: 1.5px solid var(--line-2);
  background: var(--surface); font-weight: 600; cursor: pointer; transition: all var(--t-fast) var(--ease-out);
}
.pick:hover { border-color: #b9a8e6; transform: translateY(-1px); }
.pick[aria-pressed=true] { border-color: transparent; background: var(--grad); color: #fff; box-shadow: var(--sh-brand); animation: pop var(--t) var(--ease-spring); }
.pick .ic { width: 16px; height: 16px; }
.pick-add { border-style: dashed; color: var(--brand); }

/* range */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: linear-gradient(90deg, #7c3aed, #db2777) 0 / var(--fill, 0%) 100% no-repeat, #e8e4f3; }
input[type=range]::-moz-range-track { height: 8px; border-radius: 99px; background: #e8e4f3; }
input[type=range]::-moz-range-progress { height: 8px; border-radius: 99px; background: linear-gradient(90deg, #7c3aed, #db2777); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -9px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); box-shadow: 0 2px 8px rgba(109, 40, 217, .35); transition: transform var(--t-fast) var(--ease-spring); }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); box-shadow: 0 2px 8px rgba(109, 40, 217, .35); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.18); }

/* switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 42px; height: 24px; border-radius: 99px; background: #d9d4e6; position: relative; transition: background var(--t); flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: transform var(--t) var(--ease-spring); }
.switch input:checked + .track { background: var(--ready); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid #a78bfa; outline-offset: 2px; }

/* ------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .93rem; }
.table th, .table td { padding: .75rem .9rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); color: var(--muted); font-size: .8rem; font-weight: 650; letter-spacing: .02em; white-space: nowrap; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: #faf8ff; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table tbody th { font-weight: 600; }
.table .num { text-align: right; }
.table .col-check { width: 48px; text-align: center; }
.table tr.is-selected { background: #f6f1ff; }
.row-in { animation: fade-in var(--t) var(--ease-out) backwards; animation-delay: calc(min(var(--i, 0), 20) * 18ms); }

/* ------------------------------------------------------- loading/empty */
.skeleton { position: relative; overflow: hidden; background: #eeebf5; border-radius: 8px; color: transparent !important; min-height: 1em; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent); animation: shimmer 1.3s ease-in-out infinite; }
.sk-line { height: 14px; margin: .35rem 0; }
.sk-value { display: inline-block; width: 6ch; height: 2.1rem; }
.sk-block { height: 120px; border-radius: var(--r); }
.empty { display: grid; justify-items: center; text-align: center; gap: .5rem; padding: 2.2rem 1rem; color: var(--muted); }
.empty-ico { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--grad-soft); color: var(--brand); margin-bottom: .35rem; animation: float 3.2s ease-in-out infinite; }
.empty-ico .ic { width: 30px; height: 30px; }
.empty h3 { color: var(--ink); font-size: 1.05rem; }
.empty p { max-width: 42ch; }
.empty .btn { margin-top: .5rem; }
.state:empty { display: none; }
.state.error { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .85rem 1rem; border-radius: var(--r); background: var(--danger-bg); color: var(--danger); font-weight: 600; margin-top: .75rem; }

/* ------------------------------------------------------------- toasts */
.toasts { position: fixed; top: 1rem; right: 1rem; z-index: 300; display: grid; gap: .6rem; width: min(380px, calc(100vw - 2rem)); pointer-events: none; }
/* Shown as a manual popover so toasts sit in the top layer, above open modal dialogs. */
.toasts[popover] { inset: 1rem 1rem auto auto; margin: 0; padding: 0; border: 0; background: transparent; overflow: visible; color: inherit; }
.toasts[popover]:not(:popover-open) { display: grid; }
.toast {
  pointer-events: auto; position: relative; overflow: hidden; display: flex; gap: .7rem; align-items: flex-start; padding: .85rem 1rem .95rem;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-3); font-weight: 550; font-size: .93rem;
  animation: toast-in var(--t-slow) var(--ease-spring) both;
}
.toast .tile { width: 30px; height: 30px; border-radius: 9px; }
.toast .ic { width: 17px; height: 17px; }
.toast.leaving { animation: toast-out 200ms var(--ease-in) forwards; }
.toast::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--tone, var(--brand)); transform-origin: left; animation: drain var(--life, 4500ms) linear forwards; opacity: .55; }
.toast-close { margin-left: auto; border: 0; background: none; color: var(--muted); cursor: pointer; padding: .1rem; border-radius: 6px; }

/* ------------------------------------------------------------- dialog */
.dialog { border: 0; padding: 0; border-radius: var(--r-xl); box-shadow: var(--sh-3); width: min(460px, calc(100vw - 2rem)); background: var(--surface); color: var(--ink); }
.dialog[open] { animation: dialog-in var(--t) var(--ease-spring); }
.dialog::backdrop { background: rgba(30, 24, 56, .45); backdrop-filter: blur(3px); animation: fade-in var(--t) var(--ease-out); }
.dialog-body { padding: 1.6rem; display: grid; gap: .9rem; }
.dialog-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--tone-bg, var(--brand-soft)); color: var(--tone, var(--brand)); animation: pop var(--t-slow) var(--ease-spring) 60ms both; }
.dialog-ico .ic { width: 26px; height: 26px; }
.dialog h2 { font-size: 1.2rem; }
.dialog p { color: var(--ink-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; margin-top: .4rem; }
.drawer { margin: 0 0 0 auto; height: 100vh; height: 100dvh; max-height: none; width: min(760px, 100vw); border-radius: var(--r-xl) 0 0 var(--r-xl); }
.drawer[open] { animation: drawer-in var(--t-slow) var(--ease-out); }
.drawer .dialog-body { height: 100%; grid-template-rows: auto auto auto 1fr auto; overflow: hidden; padding: 1.4rem 1.5rem; }
.drawer-scroll { overflow: auto; min-height: 0; margin: 0 -.25rem; padding: 0 .25rem; }

/* ========================================================== DASHBOARD */
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 1.8rem 2rem; color: #fff; background: var(--grad);
  box-shadow: 0 18px 40px rgba(109, 40, 217, .25); display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .12); pointer-events: none; }
.hero::before { width: 320px; height: 320px; right: -80px; top: -150px; animation: drift 9s ease-in-out infinite; }
.hero::after { width: 200px; height: 200px; right: 180px; bottom: -130px; animation: drift 11s ease-in-out infinite reverse; }
.hero-text { position: relative; z-index: 1; display: grid; gap: .35rem; flex: 1; min-width: 240px; }
.hero-kicker { font-size: .85rem; opacity: .85; font-weight: 600; }
.hero h2 { font-size: 1.65rem; font-weight: 750; }
.hero p { opacity: .92; max-width: 56ch; }
.hero .btn { position: relative; z-index: 1; background: #fff; color: var(--brand); border-color: transparent; box-shadow: 0 8px 20px rgba(30, 24, 56, .18); }
.hero .btn:hover { transform: translateY(-2px); }
.hero-actions { display: flex; gap: .6rem; flex-wrap: wrap; position: relative; z-index: 1; }
.hero .btn-glass { background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .35); box-shadow: none; }
.hero .btn-glass:hover { background: rgba(255, 255, 255, .26); }

.todo { display: grid; gap: .6rem; list-style: none; margin: 0 0 1rem; padding: 0; }
.todo-item {
  display: flex; align-items: center; gap: .85rem; padding: .8rem .9rem; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-2);
  text-decoration: none; color: inherit; transition: transform var(--t) var(--ease-out), border-color var(--t), background var(--t);
}
.todo-item:hover { transform: translateX(4px); border-color: #d6c9f5; background: #fbf9ff; }
.todo-item .grow { min-width: 0; }
.todo-item strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-item .hint { display: block; }
.todo-item > .ic:last-child { color: var(--muted); transition: transform var(--t) var(--ease-out); }
.todo-item:hover > .ic:last-child { transform: translateX(3px); color: var(--brand); }
.all-clear { display: flex; align-items: center; gap: .85rem; padding: 1rem; border-radius: var(--r); background: var(--ok-bg); color: var(--ok); font-weight: 600; }

.funnel { display: grid; gap: .8rem; }
.funnel-row { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) 8rem; align-items: center; gap: .8rem; }
.funnel-label { font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.funnel-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.funnel-val small { display: block; font-weight: 500; color: var(--muted); font-size: .75rem; }
.bar { position: relative; height: 14px; border-radius: 99px; background: #efecf6; overflow: hidden; }
.bar > i { position: absolute; inset: 0; border-radius: inherit; background: var(--c, var(--grad)); transform-origin: left; transform: scaleX(var(--w, 0)); transition: transform 900ms var(--ease-out); }
.bar.tall { height: 22px; }

.board { display: grid; gap: .55rem; }
.board-row { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; align-items: center; gap: .8rem; padding: .55rem .5rem; border-radius: var(--r); transition: background var(--t-fast); }
.board-row:hover { background: var(--surface-2); }
.rank { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-weight: 750; font-size: .9rem; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.rank-1 { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #78350f; border-color: transparent; }
.rank-2 { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #1f2937; border-color: transparent; }
.rank-3 { background: linear-gradient(135deg, #fed7aa, #ea580c); color: #7c2d12; border-color: transparent; }
.board-name { font-weight: 650; display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .3rem; }
.board-name > span:last-child { font-size: .8rem; color: var(--muted); font-weight: 500; }
.board-rate { font-size: 1.15rem; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--brand); text-align: right; min-width: 4.5rem; }
.board-rate small { display: block; font-size: .72rem; color: var(--muted); font-weight: 500; }

.onboard { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.ob-step { display: grid; gap: .45rem; padding: 1rem; border-radius: var(--r); border: 1.5px dashed var(--line-2); text-decoration: none; color: inherit; transition: all var(--t) var(--ease-out); }
.ob-step:hover { border-color: var(--brand); background: #fcfaff; }
.ob-step .tile { width: 34px; height: 34px; }
.ob-step.done { border-style: solid; border-color: #bbf0d2; background: #f3fcf7; }
.ob-step.done .tile { background: var(--ready); color: #fff; animation: pop var(--t-slow) var(--ease-spring); }
.ob-step.next { border-style: solid; border-color: #cdb8fb; background: #fbf8ff; box-shadow: 0 0 0 4px rgba(124, 58, 237, .08); }
.ob-step strong { font-size: .95rem; }
.ob-progress { margin-top: .9rem; }

.mini-camps { display: grid; gap: .5rem; }

/* ============================================================= IMPORT */
.steps-v { display: grid; gap: 1.4rem; counter-reset: s; }
.step-block { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 1rem; }
.step-no { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 750; transition: all var(--t) var(--ease-spring); }
.step-block.done .step-no { background: var(--grad); color: #fff; box-shadow: var(--sh-brand); transform: scale(1.05); }
.step-block h3 { font-size: 1rem; margin-bottom: .2rem; }
.step-block .hint { margin-bottom: .7rem; }
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tab { position: relative; border: 0; background: none; padding: .65rem 1rem; font-weight: 650; color: var(--muted); cursor: pointer; display: inline-flex; gap: .45rem; align-items: center; min-height: 44px; }
.tab::after { content: ""; position: absolute; left: .6rem; right: .6rem; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--grad); transform: scaleX(0); transition: transform var(--t) var(--ease-out); }
.tab[aria-selected=true] { color: var(--brand); }
.tab[aria-selected=true]::after { transform: scaleX(1); }
.tab-panel { animation: fade-in var(--t) var(--ease-out); }

.dropzone {
  position: relative; display: grid; justify-items: center; gap: .55rem; text-align: center; padding: 2.4rem 1.2rem; border-radius: var(--r-lg);
  border: 2px dashed #cfc4ec; background: var(--surface-2); cursor: pointer; transition: border-color var(--t), background var(--t), transform var(--t) var(--ease-out);
}
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dropzone:hover { border-color: var(--brand); background: #fbf9ff; }
.dropzone:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(124, 58, 237, .14); }
.dropzone.drag { border-color: var(--brand-2); background: var(--grad-soft); transform: scale(1.01); }
.dropzone.drag .dz-ico { animation: bounce 700ms var(--ease-spring) infinite; }
.dropzone.has-file { border-style: solid; border-color: #b7e8cf; background: #f3fcf7; }
.dz-ico { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: var(--sh-brand); }
.dz-ico .ic { width: 30px; height: 30px; }
.has-file .dz-ico { background: var(--ready); box-shadow: 0 8px 20px rgba(4, 120, 87, .25); animation: pop var(--t-slow) var(--ease-spring); }
.dz-title { font-weight: 700; font-size: 1.05rem; }
.dz-name { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .8rem; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: .88rem; }

.inline-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: .6rem; align-items: end; padding: 1rem; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); margin-top: .8rem; animation: fade-up var(--t) var(--ease-out); }

.result-hero { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.big-check { width: 64px; height: 64px; flex: none; }
.big-check circle { fill: var(--ok-bg); stroke: var(--ok); stroke-width: 3; stroke-dasharray: 190; stroke-dashoffset: 190; animation: draw 600ms var(--ease-out) forwards; }
.big-check path { fill: none; stroke: var(--ok); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 50; stroke-dashoffset: 50; animation: draw 420ms var(--ease-out) 420ms forwards; }
.result-big { font-size: 2.4rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stackbar { display: flex; height: 18px; border-radius: 99px; overflow: hidden; background: #efecf6; gap: 2px; }
.stackbar > i { display: block; height: 100%; background: var(--c); flex: var(--f, 0) 0 0; transform-origin: left; animation: grow-x 900ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 120ms + 150ms); min-width: 0; }
.legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .65rem; margin-top: 1rem; }
.legend-item { display: flex; align-items: center; gap: .6rem; padding: .7rem .8rem; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.legend-item .dot { width: 12px; height: 12px; }
.legend-item b { display: block; font-size: 1.25rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.legend-item span { font-size: .82rem; color: var(--muted); }
.meta-line { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; color: var(--muted); font-size: .85rem; margin-top: .9rem; }
.meta-line b { color: var(--ink-2); font-weight: 600; }

/* ============================================================ NUMBERS */
.filterbar { display: grid; grid-template-columns: minmax(200px, 1.2fr) auto minmax(180px, 1fr) auto; gap: .8rem; align-items: end; margin-bottom: 1rem; }
.multi { position: relative; }
.multi summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 46px; padding: .55rem .85rem;
  border: 1.5px solid var(--line-2); border-radius: var(--r); background: var(--surface); cursor: pointer; font-weight: 550;
}
.multi summary::-webkit-details-marker { display: none; }
.multi summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform var(--t); }
.multi[open] summary { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(124, 58, 237, .14); }
.multi[open] summary::after { transform: rotate(225deg) translateY(-2px); }
.multi-panel { position: absolute; z-index: 25; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-3); padding: .4rem; max-height: 280px; overflow: auto; animation: drop-in var(--t) var(--ease-out); }
.multi-panel label { display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem; border-radius: 8px; cursor: pointer; }
.multi-panel label:hover { background: var(--surface-2); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; color: var(--muted); font-size: .9rem; }
.pager:empty { display: none; }

.selbar {
  position: fixed; left: 50%; bottom: 1.4rem; z-index: 60; display: flex; align-items: center; gap: .9rem; padding: .65rem .7rem .65rem 1.1rem;
  border-radius: 18px; background: #1e1838; color: #fff; box-shadow: 0 18px 44px rgba(30, 24, 56, .35); transform: translate(-50%, 160%);
  transition: transform var(--t-slow) var(--ease-spring); max-width: calc(100vw - 2rem);
}
.selbar.show { transform: translate(-50%, 0); }
.selbar .sel-n { font-weight: 750; font-variant-numeric: tabular-nums; }
.selbar .btn-ghost { color: #d9d3ee; }
.selbar .btn-ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }
@media (min-width: 961px) { .selbar { left: calc(50% + var(--sidebar-w) / 2); } }

/* ========================================================== CAMPAIGNS */
.view { animation: fade-up var(--t-slow) var(--ease-out); }
.list-toolbar { justify-content: space-between; margin-bottom: 1.1rem; }
.camp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1.1rem; }
.camp { display: grid; gap: 1rem; padding: 1.2rem 1.25rem; position: relative; }
.camp.is-cancelled { opacity: .72; }
.camp.flash { animation: flash-ring 1.6s var(--ease-out) 2; }
.camp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.camp-title { font-size: 1.08rem; font-weight: 700; overflow-wrap: anywhere; }
.camp-meta { display: flex; flex-wrap: wrap; gap: .3rem .9rem; color: var(--muted); font-size: .82rem; margin-top: .2rem; }
.camp-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.camp-kpis { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; align-items: center; }
.camp-count { font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.camp-count small { display: block; font-size: .78rem; font-weight: 500; color: var(--muted); margin-top: .25rem; }
.mini-legend { display: flex; flex-wrap: wrap; gap: .25rem .75rem; margin-top: .45rem; font-size: .78rem; color: var(--muted); }
.mini-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.mini-legend .dot { width: 8px; height: 8px; }
.stackbar.thin { height: 10px; }

.track { display: grid; grid-template-columns: repeat(3, 1fr); position: relative; padding-top: .2rem; }
.track::before, .track::after { content: ""; position: absolute; top: calc(.2rem + 15px); left: 16.66%; right: 16.66%; height: 3px; border-radius: 3px; background: #e9e5f3; }
.track::after { background: var(--grad); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform 900ms var(--ease-out) 200ms; }
.tnode { position: relative; z-index: 1; display: grid; justify-items: center; gap: .35rem; text-align: center; font-size: .78rem; color: var(--muted); font-weight: 600; }
.tdot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2.5px solid #e1dcef; color: #b5aecb; transition: all var(--t) var(--ease-spring); }
.tdot .ic { width: 15px; height: 15px; stroke-width: 2.6; }
.tnode.done .tdot { background: var(--grad); border-color: transparent; color: #fff; }
.tnode.done { color: var(--ink-2); }
.tnode.current .tdot { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 0 rgba(124, 58, 237, .45); animation: pulse 1.8s ease-out infinite; }
.tnode.current { color: var(--brand); }
.tnode.stopped .tdot { border-color: #cbd2dc; color: var(--off); background: var(--off-bg); }

.ring { width: 32px; height: 32px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring .bg { stroke: #e9e5f3; }
.ring .fg { stroke: url(#ring-grad); stroke-linecap: round; stroke-dasharray: 81.7; stroke-dashoffset: 81.7; transition: stroke-dashoffset 1s var(--ease-out) 300ms; }
.tnode .ring-wrap { position: relative; width: 32px; height: 32px; }
.tnode .ring-wrap b { position: absolute; inset: 0; display: grid; place-items: center; font-size: .6rem; color: var(--brand); font-variant-numeric: tabular-nums; }

.camp-next { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding-top: .9rem; border-top: 1px dashed var(--line-2); }
.camp-next .next-hint { width: 100%; font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; }
.camp-next .next-hint .ic { color: var(--brand); width: 15px; height: 15px; }

/* wizard */
.wizard { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.4rem; align-items: start; }
.stepper { display: flex; align-items: center; gap: .4rem; margin: 0 0 1.4rem; padding: 0; list-style: none; flex-wrap: wrap; }
.stepper > li { display: flex; }
.stepper > li.sline { flex: 1; display: block; }
.sbtn { display: inline-flex; align-items: center; gap: .55rem; border: 0; background: none; padding: .3rem .4rem; border-radius: 10px; color: var(--muted); font-weight: 650; cursor: default; }
.sbtn .sn { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-2); background: var(--surface); font-size: .85rem; transition: all var(--t) var(--ease-spring); }
.sbtn.done { color: var(--ink-2); cursor: pointer; }
.sbtn.done:hover { background: var(--surface-2); }
.sbtn.done .sn { background: var(--ready); border-color: transparent; color: #fff; }
.sbtn.active { color: var(--brand); }
.sbtn.active .sn { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--sh-brand); transform: scale(1.08); }
.sline { flex: 1; min-width: 18px; height: 3px; border-radius: 3px; background: var(--line-2); position: relative; overflow: hidden; }
.sline::after { content: ""; position: absolute; inset: 0; background: var(--ready); transform: scaleX(0); transform-origin: left; transition: transform var(--t-slow) var(--ease-out); }
.sline.done::after { transform: scaleX(1); }
.wpanel { display: grid; gap: 1.1rem; min-height: 300px; align-content: start; }
.wpanel.enter-next { animation: slide-in-r var(--t-slow) var(--ease-out); }
.wpanel.enter-back { animation: slide-in-l var(--t-slow) var(--ease-out); }
.wpanel h2 { font-size: 1.3rem; }
.wnav { display: flex; align-items: center; gap: .6rem; margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.wnav .btn-primary { margin-left: auto; }

.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; }
.src-card {
  position: relative; display: grid; gap: .3rem; text-align: left; padding: 1rem 1rem .9rem; border-radius: var(--r); border: 1.5px solid var(--line-2);
  background: var(--surface); cursor: pointer; transition: all var(--t) var(--ease-out);
}
.src-card:hover { border-color: #b9a8e6; transform: translateY(-2px); box-shadow: var(--sh-2); }
.src-card[aria-pressed=true] { border-color: var(--brand); background: #fbf8ff; box-shadow: 0 0 0 4px rgba(124, 58, 237, .12); }
.src-card .tick { position: absolute; top: .7rem; right: .7rem; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-2); color: transparent; transition: all var(--t) var(--ease-spring); }
.src-card[aria-pressed=true] .tick { background: var(--grad); border-color: transparent; color: #fff; transform: scale(1.1); }
.src-card .tick .ic { width: 14px; height: 14px; stroke-width: 3; }
.src-card strong { padding-right: 1.8rem; overflow-wrap: anywhere; }
.src-card .big { font-size: 1.45rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.src-card .hint { font-size: .78rem; }
.src-card.is-empty { opacity: .55; }
.src-card.all { background: var(--grad-soft); }

.method-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.method { display: grid; gap: .45rem; text-align: left; padding: 1.1rem; border-radius: var(--r-lg); border: 1.5px solid var(--line-2); background: var(--surface); cursor: pointer; transition: all var(--t) var(--ease-out); }
.method:hover { border-color: #b9a8e6; transform: translateY(-2px); box-shadow: var(--sh-2); }
.method[aria-pressed=true] { border-color: var(--brand); background: #fbf8ff; box-shadow: 0 0 0 4px rgba(124, 58, 237, .12); }
.method .tile { width: 44px; height: 44px; border-radius: 14px; transition: transform var(--t) var(--ease-spring); }
.method[aria-pressed=true] .tile { background: var(--grad); color: #fff; transform: rotate(-6deg) scale(1.05); }
.method strong { font-size: 1rem; }
.method span { font-size: .84rem; color: var(--muted); }

.count-box { display: grid; gap: .8rem; padding: 1.1rem 1.2rem; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); }
.count-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.count-input { width: 9rem !important; font-size: 1.3rem !important; font-weight: 750; text-align: center; font-variant-numeric: tabular-nums; }
.count-max { color: var(--muted); font-size: .9rem; }
.quick { display: flex; gap: .4rem; flex-wrap: wrap; }

.summary { position: sticky; top: 92px; display: grid; gap: .9rem; }
.sum-list { display: grid; gap: .7rem; margin: 0; }
.sum-list div { display: flex; justify-content: space-between; gap: .8rem; font-size: .92rem; }
.sum-list dt { color: var(--muted); }
.sum-list dd { margin: 0; font-weight: 650; text-align: right; overflow-wrap: anywhere; }
.sum-big { text-align: center; padding: 1rem; border-radius: var(--r); background: var(--grad-soft); }
.sum-big b { display: block; font-size: 2.3rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sum-big span { font-size: .85rem; color: var(--muted); }
.files-viz { display: flex; flex-wrap: wrap; gap: .35rem; }
.files-viz i { width: 22px; height: 28px; border-radius: 4px 9px 4px 4px; background: var(--brand-soft); border: 1.5px solid #d7c8fb; animation: pop var(--t) var(--ease-spring) both; animation-delay: calc(var(--i, 0) * 40ms); }

.success { display: grid; justify-items: center; text-align: center; gap: .8rem; padding: 2rem 1rem; }
.success .big-check { width: 88px; height: 88px; }
.success h2 { font-size: 1.5rem; }
.success p { color: var(--muted); max-width: 52ch; }
.success .stackbar { width: min(520px, 100%); }
.success .row { justify-content: center; margin-top: .4rem; }
.next-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; width: min(640px, 100%); margin-top: .6rem; text-align: left; }
.next-steps div { padding: .8rem .9rem; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-2); font-size: .85rem; color: var(--ink-2); }
.next-steps b { display: block; color: var(--brand); font-size: .8rem; margin-bottom: .15rem; }

/* outcome drawer */
.oc-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .5rem; }
.oc-pill { padding: .55rem .6rem; border-radius: var(--r); background: var(--tone-bg); color: var(--tone); text-align: center; border: 0; cursor: pointer; transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast); }
.oc-pill:hover { transform: translateY(-1px); }
.oc-pill[aria-pressed=true] { box-shadow: 0 0 0 2px var(--tone); }
.oc-pill b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.oc-pill span { font-size: .75rem; font-weight: 650; }
.t-interested { --tone: var(--ok); --tone-bg: var(--ok-bg); }
.t-not_interested { --tone: var(--bad); --tone-bg: var(--bad-bg); }
.t-unreachable { --tone: var(--off); --tone-bg: var(--off-bg); }
.t-follow_up { --tone: var(--follow); --tone-bg: var(--follow-bg); }
.t-blocked { --tone: var(--blocked); --tone-bg: var(--blocked-bg); }
.t-pending { --tone: #5f5a74; --tone-bg: #f1eff6; }
.progress-line { display: flex; align-items: center; gap: .75rem; font-size: .88rem; color: var(--muted); }
.progress-line .bar { flex: 1; }
.oc-list { display: grid; gap: .35rem; }
.oc-row { display: grid; grid-template-columns: 30px minmax(110px, 1fr) minmax(0, 1fr) auto; align-items: center; gap: .7rem; padding: .5rem .6rem; border-radius: var(--r); border: 1px solid transparent; transition: background var(--t-fast), border-color var(--t-fast); }
.oc-row:hover { background: var(--surface-2); }
.oc-row:focus { outline: none; border-color: #cdb8fb; background: #fbf8ff; }
.oc-row.saved { animation: saved 700ms var(--ease-out); }
.oc-row .phone { font-weight: 650; font-variant-numeric: tabular-nums; }
.oc-row .src { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-btns { display: flex; gap: .25rem; }
.oc-btn { min-width: 40px; height: 36px; padding: 0 .6rem; border-radius: 10px; border: 1.5px solid var(--line-2); background: var(--surface); font-size: .78rem; font-weight: 650; color: var(--ink-2); cursor: pointer; transition: all var(--t-fast) var(--ease-out); display: inline-flex; align-items: center; gap: .3rem; }
.oc-btn kbd { font: inherit; font-size: .68rem; color: var(--muted); }
.oc-btn:hover { border-color: var(--tone); color: var(--tone); }
.oc-btn[aria-pressed=true] { background: var(--tone); border-color: var(--tone); color: #fff; animation: pop var(--t) var(--ease-spring); }
.oc-btn[aria-pressed=true] kbd { color: rgba(255, 255, 255, .8); }
.oc-bulk { position: sticky; top: 0; z-index: 2; margin-bottom: .5rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .6rem .7rem; border-radius: var(--r); background: #1e1838; color: #fff; animation: fade-up var(--t) var(--ease-out); }
.oc-bulk .oc-btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .25); }
.oc-bulk .oc-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.kbd-hint { font-size: .8rem; color: var(--muted); display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.kbd-hint kbd { font: inherit; font-size: .72rem; padding: .05rem .4rem; border-radius: 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--surface); }

/* ============================================================ SOURCES */
.src-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 1.1rem; }
.scard { display: grid; gap: .95rem; padding: 1.2rem 1.25rem; }
.scard.off { opacity: .7; }
.scard-head { display: flex; gap: .8rem; align-items: flex-start; }
.avatar { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 750; color: #fff; background: var(--c, var(--grad)); flex: none; font-size: 1.05rem; }
.scard-name { font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.scard-note { font-size: .84rem; color: var(--muted); overflow-wrap: anywhere; }
.scard-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.scard-kpis div { padding: .55rem .6rem; border-radius: var(--r); background: var(--surface-2); text-align: center; }
.scard-kpis b { display: block; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.scard-kpis span { font-size: .74rem; color: var(--muted); }
.scard-rate { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.scard-rate b { font-size: 1.5rem; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.scard-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem; padding-top: .8rem; border-top: 1px dashed var(--line-2); }
.scard-foot .row { flex-wrap: nowrap; margin-left: auto; }

/* ============================================================== LOGIN */
.login-page { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--surface); }
.login-art { position: relative; overflow: hidden; background: var(--grad); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.login-art .blob { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .13); }
.login-art .b1 { width: 420px; height: 420px; right: -140px; top: -120px; animation: drift 12s ease-in-out infinite; }
.login-art .b2 { width: 260px; height: 260px; left: -80px; bottom: -60px; animation: drift 9s ease-in-out infinite reverse; }
.login-art .b3 { width: 120px; height: 120px; left: 45%; top: 40%; animation: float 5s ease-in-out infinite; }
.login-art .brand { color: #fff; position: relative; }
.login-art .brand-mark { background: rgba(255, 255, 255, .2); box-shadow: none; }
.login-art .brand small { color: rgba(255, 255, 255, .8); }
.login-copy { position: relative; display: grid; gap: .9rem; max-width: 440px; }
.login-copy h2 { font-size: 2.1rem; font-weight: 800; line-height: 1.25; }
.login-flow { display: grid; gap: .55rem; margin-top: .6rem; }
.login-flow div { display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; border-radius: 12px; background: rgba(255, 255, 255, .13); backdrop-filter: blur(4px); font-weight: 600; animation: fade-up var(--t-slow) var(--ease-out) both; }
.login-flow div:nth-child(2) { animation-delay: 90ms; } .login-flow div:nth-child(3) { animation-delay: 180ms; } .login-flow div:nth-child(4) { animation-delay: 270ms; }
.login-flow .ic { width: 18px; height: 18px; }
.login-form-wrap { display: grid; place-items: center; padding: 2rem; }
.login-card { width: min(400px, 100%); display: grid; gap: 1.2rem; animation: fade-up var(--t-slow) var(--ease-out); }
.login-card h1 { font-size: 1.7rem; font-weight: 750; }
.alert { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 1rem; border-radius: var(--r); font-weight: 600; font-size: .93rem; }
.alert-error { background: var(--danger-bg); color: var(--danger); animation: shake 360ms var(--ease-out); }
.alert-info { background: var(--info-bg); color: var(--info); }
.alert-warn { background: var(--warn-bg); color: var(--warn); }
.pw-wrap { position: relative; }
.pw-toggle { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: none; border-radius: 9px; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.pw-toggle:hover { background: var(--surface-2); color: var(--brand); }

/* copy dialog */
#copy-dialog { width: min(500px, calc(100vw - 2rem)); }
.copy-parts { display: grid; gap: .45rem; max-height: 46vh; overflow: auto; padding: .15rem; }
.copy-parts:empty { display: none; }
.copy-part {
  display: flex; align-items: center; gap: .7rem; width: 100%; padding: .65rem .8rem; border-radius: var(--r); border: 1.5px solid var(--line-2);
  background: var(--surface); text-align: left; cursor: pointer; min-height: 48px; transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast) var(--ease-out);
}
.copy-part:hover { border-color: #b9a8e6; transform: translateX(3px); }
.copy-part .tile { width: 32px; height: 32px; border-radius: 10px; }
.copy-part .grow b { display: block; }
.copy-part .grow span { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.copy-part .state-label { font-size: .82rem; font-weight: 650; color: var(--brand); display: inline-flex; align-items: center; gap: .3rem; }
.copy-part.copied, .btn.copied { border-color: #9fdcbc; background: #f1fbf5; }
.copy-part.copied .tile { background: var(--ready); color: #fff; animation: pop var(--t-slow) var(--ease-spring); }
.copy-part.copied .state-label { color: var(--ready); }
.btn-primary.copied { background: var(--ready); color: #fff; box-shadow: 0 8px 20px rgba(4, 120, 87, .25); }

/* ----------------------------------------------------------- confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 400; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; background: var(--c); left: var(--x); opacity: 0; animation: confetti var(--d, 1600ms) var(--ease-out) var(--delay, 0ms) forwards; }

/* ---------------------------------------------------------- keyframes */
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes shine { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes drift { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-24px, 18px) scale(1.06); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(124, 58, 237, .45); } 100% { box-shadow: 0 0 0 12px rgba(124, 58, 237, 0); } }
@keyframes flash-ring { 0% { box-shadow: 0 0 0 0 rgba(124, 58, 237, .5); } 100% { box-shadow: 0 0 0 16px rgba(124, 58, 237, 0); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px) scale(.96); } }
@keyframes drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes drawer-in { from { transform: translateX(60px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes slide-in-r { from { opacity: 0; transform: translateX(36px); } to { opacity: 1; transform: none; } }
@keyframes slide-in-l { from { opacity: 0; transform: translateX(-36px); } to { opacity: 1; transform: none; } }
@keyframes saved { 0% { background: #dcfce7; } 100% { background: transparent; } }
@keyframes confetti {
  0% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0); }
  100% { opacity: 0; transform: translate3d(var(--dx, 0), 92vh, 0) rotate(var(--r, 540deg)); }
}

/* ---------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wizard { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; }
  .onboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 86vw); transform: translateX(-104%); transition: transform var(--t-slow) var(--ease-out); box-shadow: var(--sh-3); }
  body.nav-open .sidebar { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(30, 24, 56, .4); opacity: 0; pointer-events: none; transition: opacity var(--t); }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .nav-toggle { display: inline-flex; }
  .topbar { padding: .75rem 1rem; }
  .content { padding: .5rem 1rem 6rem; }
  .grid-2, .grid-3-1 { grid-template-columns: minmax(0, 1fr); }
  .filterbar { grid-template-columns: minmax(0, 1fr); }
  .method-grid { grid-template-columns: minmax(0, 1fr); }
  .login-page { grid-template-columns: minmax(0, 1fr); }
  .login-art { padding: 2rem 1.5rem; min-height: 260px; }
  .login-copy h2 { font-size: 1.5rem; }
  .login-flow { display: none; }
  .inline-form { grid-template-columns: minmax(0, 1fr); }
  .next-steps { grid-template-columns: minmax(0, 1fr); }
  .topbar-actions .btn span { display: none; }
}
@media (max-width: 600px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .onboard { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 1.4rem; }
  .hero h2 { font-size: 1.35rem; }
  .page-sub { display: none; }
  .funnel-row { grid-template-columns: 5.5rem minmax(0, 1fr) 4.5rem; }
  .oc-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .oc-row { grid-template-columns: 30px minmax(0, 1fr); }
  .oc-row .src { display: none; }
  .oc-btns { grid-column: 1 / -1; flex-wrap: wrap; }
  .camp-grid, .src-cards { grid-template-columns: minmax(0, 1fr); }
  .drawer { border-radius: 0; }
}

/* ------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important; }
  .confetti { display: none; }
}
