/* ============================================================================
   Genufy Leads — Design System
   "Sales command center": dark ink base, gold signature accent, per-source
   color coding. Display: Bricolage Grotesque · Body: Hanken Grotesk · Figures:
   JetBrains Mono.
   ========================================================================== */

:root {
  /* base surfaces — Genufy navy */
  --bg:        #070a1a;
  --bg-2:      #0a0e22;
  --surface:   #10152e;
  --surface-2: #171d3a;
  --surface-3: #212949;
  --line:      rgba(255,255,255,.08);
  --line-2:    rgba(255,255,255,.14);

  /* text */
  --text:  #eef1f8;
  --muted: #9aa2b8;
  --dim:   #626b86;

  /* signature accent — Genufy teal (kept var name --gold for brevity; it's the
     green→cyan brand accent now, not gold) */
  --gold:      #1fe0c0;
  --gold-soft: rgba(31,224,192,.14);
  --gold-line: rgba(31,224,192,.38);
  --acc-green: #83ea4c;
  --acc-cyan:  #14d8d4;
  --grad:      linear-gradient(135deg, #83ea4c, #14d8d4);

  /* source palette */
  --linkedin:   #4a90e2;
  --apollo:     #9b7bf0;
  --salesforce: #2aa9e0;
  --vendor:     #f2793f;

  /* stage / semantic */
  --green: #43d98f;
  --red:   #f26d6d;
  --amber: #f5b544;
  --blue:  #5b9bd5;

  --radius:   14px;
  --radius-s: 10px;
  --radius-l: 20px;
  --shadow:   0 20px 50px -20px rgba(0,0,0,.7);
  --shadow-s: 0 8px 24px -12px rgba(0,0,0,.6);

  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Hanken Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --sidebar-w: 244px;
}

/* ---- Light theme -------------------------------------------------------- */
:root[data-theme="light"] {
  --bg:        #eef1f7;
  --bg-2:      #f7f9fc;
  --surface:   #ffffff;
  --surface-2: #f1f4fa;
  --surface-3: #e5eaf2;
  --line:      rgba(15,25,50,.10);
  --line-2:    rgba(15,25,50,.17);

  --text:  #101a33;
  --muted: #55607a;
  --dim:   #8a93a8;

  --gold:      #0e9e88;   /* deeper teal so accent text is legible on light */
  --gold-soft: rgba(14,158,136,.14);
  --gold-line: rgba(14,158,136,.40);

  --green: #12b877;
  --red:   #e0524f;
  --amber: #d99514;
  --blue:  #3b7fc4;

  --shadow:   0 18px 44px -22px rgba(20,35,70,.28);
  --shadow-s: 0 8px 22px -14px rgba(20,35,70,.20);
}
:root[data-theme="light"] .grain { opacity: .02; mix-blend-mode: multiply; }

* { box-sizing: border-box; }
/* Default icon size — specific containers (.btn svg, .empty svg, …) override this. */
svg.ico { width: 16px; height: 16px; flex: none; vertical-align: middle; }
.dl dd svg.ico { width: 13px; height: 13px; opacity: .6; margin-left: 2px; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; margin: 0; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; }
::selection { background: var(--gold); color: #04241d; }

/* film-grain overlay for atmosphere */
.grain {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* scrollbars */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 20px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--surface-3) 65%, var(--text)); }
::-webkit-scrollbar-track { background: transparent; }

/* ============================ Splash ==================================== */
.splash {
  position: fixed; inset: 0; z-index: 500; display: grid; place-items: center;
  background: var(--bg); transition: opacity .4s ease, visibility .4s;
}
.splash.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.splash__mark { color: var(--gold); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100%{ opacity:.35; transform: translateY(0) } 50%{ opacity:1; transform: translateY(-4px) } }

/* ============================ Login ===================================== */
.login {
  position: relative; min-height: 100dvh; display: grid; place-items: center;
  padding: 32px; overflow: hidden;
  background:
    radial-gradient(120% 90% at 85% -10%, rgba(31,224,192,.10), transparent 45%),
    radial-gradient(90% 80% at 10% 110%, rgba(74,144,226,.10), transparent 50%),
    var(--bg);
}
.login[hidden] { display: none; }
.login__aura {
  position: absolute; width: 520px; height: 520px; right: -140px; top: -160px;
  background: radial-gradient(circle, rgba(31,224,192,.16), transparent 60%);
  filter: blur(20px); animation: float 12s ease-in-out infinite;
}
@keyframes float { 0%,100%{ transform: translate(0,0) } 50%{ transform: translate(-24px,26px) } }
.login__grid {
  position: absolute; inset: 0; opacity: .5;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 30%, transparent 75%);
}
.login__panel {
  position: relative; z-index: 2; width: min(520px, 100%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 80%, transparent), color-mix(in srgb, var(--bg-2) 80%, transparent));
  border: 1px solid var(--line-2); border-radius: var(--radius-l);
  padding: 40px 40px 34px; backdrop-filter: blur(14px); box-shadow: var(--shadow);
  animation: rise .7s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px) } to { opacity: 1; transform: none } }

.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; }
.brand__mark { color: var(--gold); display: grid; place-items: center; }
.brand__name { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -.03em; }
.brand__sub {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--dim); border-left: 1px solid var(--line-2); padding-left: 10px; margin-left: 2px;
}
.login__title { font-size: clamp(30px, 4.5vw, 44px); line-height: 1.02; font-weight: 800; }
.login__lede { color: var(--muted); margin: 16px 0 24px; max-width: 42ch; font-size: 15px; }

.login__sources { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.src-chip {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 100px; border: 1px solid var(--line-2);
  color: var(--muted); display: inline-flex; align-items: center; gap: 7px;
}
.src-chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--muted)); }
.src-chip[data-source="linkedin"]   { --c: var(--linkedin); }
.src-chip[data-source="apollo"]     { --c: var(--apollo); }
.src-chip[data-source="salesforce"] { --c: var(--salesforce); }
.src-chip[data-source="vendor"]     { --c: var(--vendor); }

.btn-ms {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--grad); color: #04241d; border: none; border-radius: var(--radius-s);
  padding: 15px; font-weight: 700; font-size: 15px; letter-spacing: -.01em;
  transition: transform .12s ease, box-shadow .2s ease, filter .2s;
  box-shadow: 0 12px 30px -12px rgba(31,224,192,.6);
}
.btn-ms:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 16px 36px -12px rgba(31,224,192,.7); }
.btn-ms:active { transform: translateY(0); }

.login__note { color: var(--dim); font-size: 12.5px; margin: 14px 0 0; text-align: center; }
.login__note strong { color: var(--gold); font-weight: 600; }
.login__error {
  margin: 14px 0 0; padding: 10px 12px; border-radius: var(--radius-s);
  background: color-mix(in srgb, var(--red) 14%, transparent); border: 1px solid color-mix(in srgb, var(--red) 34%, transparent); color: color-mix(in srgb, var(--red) 62%, var(--text));
  font-size: 13px; text-align: center;
}
.login__demo {
  margin: 20px 0 0; padding-top: 18px; border-top: 1px dashed var(--line-2);
  color: var(--dim); font-size: 12.5px; text-align: center;
}
.linklike { background: none; border: none; color: var(--gold); font-weight: 600; font-size: inherit; padding: 0; }
.linklike:hover { text-decoration: underline; }
.login__foot {
  position: absolute; bottom: 20px; left: 0; right: 0; text-align: center;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--dim); z-index: 2;
}

/* ============================ App shell ================================= */
.app-root { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100dvh; }
.app-root[hidden] { display: none; }

.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-right: 1px solid var(--line); padding: 20px 14px;
}
.sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 22px; }
.sidebar__brand .brand__mark { color: var(--gold); }
.sidebar__brand b { font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: -.03em; }
.sidebar__brand span { font-family: var(--font-mono); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); display: block; margin-top: 1px; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav__label { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--dim); padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--radius-s);
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: 13.5px;
  transition: background .15s, color .15s; position: relative;
}
.nav a svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.nav a .count { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--dim); background: var(--surface-2); padding: 1px 7px; border-radius: 100px; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.active { background: var(--gold-soft); color: var(--gold); }
.nav a.active::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.nav a.active .count { color: var(--gold); background: rgba(31,224,192,.16); }

.sidebar__foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.userbox { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-s); }
.userbox:hover { background: var(--surface); }
.avatar {
  width: 32px; height: 32px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: var(--grad); color: #04241d; font-weight: 700; font-size: 13px;
  font-family: var(--font-display);
}
.userbox__meta { min-width: 0; }
.userbox__meta b { font-size: 13px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userbox__meta span { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.userbox button { margin-left: auto; background: none; border: none; color: var(--dim); padding: 4px; border-radius: 6px; }
.userbox button:hover { color: var(--red); background: var(--surface-2); }

/* ============================ Main / topbar ============================= */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 16px;
  padding: 18px 30px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar__title h1 { font-size: 22px; }
.topbar__title p { margin: 2px 0 0; color: var(--dim); font-size: 12.5px; }
.topbar__spacer { flex: 1; }
.search {
  display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 100px; padding: 8px 14px; width: 260px; transition: border-color .15s, width .2s;
}
.search:focus-within { border-color: var(--gold-line); width: 300px; }
.search svg { width: 15px; height: 15px; color: var(--dim); flex: none; }
.search input { background: none; border: none; color: var(--text); outline: none; width: 100%; font-size: 13.5px; }
.search input::placeholder { color: var(--dim); }

/* opacity-only fade — no transform, so .view never becomes the containing block
   for its position:fixed children (e.g. the bulk-select bar). */
.view { padding: 26px 30px 60px; animation: fade .4s ease both; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

/* ============================ Buttons / controls ======================= */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: var(--radius-s);
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font-weight: 600; font-size: 13px; transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--surface-3); border-color: var(--line-2); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn--gold { background: var(--grad); color: #04241d; border-color: transparent; box-shadow: 0 10px 24px -14px rgba(31,224,192,.7); }
.btn--gold:hover { filter: brightness(1.06); }
.btn--ghost { background: transparent; }
.btn--sm { padding: 6px 11px; font-size: 12px; }
.btn--danger:hover { background: rgba(242,109,109,.14); border-color: rgba(242,109,109,.4); color: #ffb4b4; }

.select, .input, .textarea {
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius-s); padding: 9px 12px; font-family: inherit; font-size: 13.5px; outline: none;
  transition: border-color .15s; width: 100%;
}
.select:focus, .input:focus, .textarea:focus { border-color: var(--gold-line); }
.textarea { resize: vertical; min-height: 76px; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 6px; font-weight: 500; letter-spacing: .01em; }

/* segmented filter row */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 100px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  font-size: 12.5px; font-weight: 500; transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.active { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--dim)); }
#lead-filters { align-items: flex-end; gap: 12px; }
.filter-field { display: inline-flex; flex-direction: column; gap: 5px; }
.filter-label { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); padding-left: 2px; }
.select--sm { width: auto; min-width: 132px; padding: 8px 11px; font-size: 12.5px; cursor: pointer; }
.date-range { display: inline-flex; align-items: center; gap: 8px; }
.date-range .input { width: auto; padding: 7px 10px; font-size: 12.5px; color-scheme: dark; }
:root[data-theme="light"] .date-range .input { color-scheme: light; }

/* ============================ Cards / KPIs ============================= */
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(4, 1fr); margin-bottom: 20px; }
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  position: relative; overflow: hidden;
}
.card--pad { padding: 20px 22px; }
.kpi__label { font-size: 11.5px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.kpi__label .ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--gold); }
.kpi__label .ic svg { width: 15px; height: 15px; }
.kpi__value { font-family: var(--font-display); font-weight: 800; font-size: 30px; margin-top: 12px; letter-spacing: -.03em; }
.kpi__value small { font-size: 15px; color: var(--dim); font-weight: 600; }
.kpi__delta { font-family: var(--font-mono); font-size: 11px; margin-top: 6px; color: var(--dim); }
.kpi__delta.up { color: var(--green); } .kpi__delta.down { color: var(--red); }
.kpi__spark { position: absolute; right: 14px; bottom: 12px; opacity: .8; }

.section-head { display: flex; align-items: baseline; gap: 12px; margin: 8px 0 14px; }
.section-head h2 { font-size: 16px; }
.section-head .muted { color: var(--dim); font-size: 12.5px; }
.section-head .btn { margin-left: auto; }

.two-col { grid-template-columns: 1.55fr 1fr; align-items: start; }

/* ============================ Badges =================================== */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 100px;
  font-size: 11px; font-weight: 600; font-family: var(--font-mono); letter-spacing: .02em; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--source { border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.src-linkedin   { --c: var(--linkedin); } .src-apollo { --c: var(--apollo); }
.src-salesforce { --c: var(--salesforce); } .src-vendor { --c: var(--vendor); }

.badge--stage { border: 1px solid var(--line-2); color: var(--muted); background: var(--surface-2); }
.stage-new { color: var(--blue); } .stage-contacted { color: #8aa0b8; }
.stage-qualified { color: var(--gold); } .stage-demo { color: var(--apollo); }
.stage-proposal { color: var(--vendor); } .stage-won { color: var(--green); }
.stage-lost { color: var(--red); }

.pri { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; }
.pri::before { content: ''; width: 7px; height: 7px; border-radius: 2px; }
.pri-high::before { background: var(--red); } .pri-high { color: color-mix(in srgb, var(--red) 68%, var(--text)); }
.pri-medium::before { background: var(--amber); } .pri-medium { color: color-mix(in srgb, var(--amber) 66%, var(--text)); }
.pri-low::before { background: var(--dim); } .pri-low { color: var(--muted); }

/* ============================ Table =================================== */
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.table-scroll { overflow-x: auto; }
table.leads { width: 100%; border-collapse: collapse; min-width: 880px; }
table.leads th {
  text-align: left; font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--dim); font-weight: 600; padding: 13px 16px; border-bottom: 1px solid var(--line);
  background: var(--bg-2); position: sticky; top: 0; cursor: pointer; user-select: none; white-space: nowrap;
}
table.leads th:hover { color: var(--muted); }
table.leads th .arrow { opacity: .5; font-size: 9px; }
table.leads td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.leads tbody tr { transition: background .12s; cursor: pointer; }
table.leads tbody tr:hover { background: var(--surface-2); }
table.leads tbody tr:last-child td { border-bottom: none; }
.lead-name { font-weight: 600; font-size: 13.5px; }
.lead-sub { color: var(--dim); font-size: 12px; margin-top: 1px; }
.val { font-family: var(--font-mono); font-weight: 700; font-size: 13px; }
.cell-owner { display: flex; align-items: center; gap: 8px; }
.avatar--xs { width: 24px; height: 24px; font-size: 10px; border-radius: 7px; }

/* multi-select */
th.check-cell, td.check-cell { width: 42px; padding-left: 16px; padding-right: 0; cursor: default; }
.row-check {
  width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line-2);
  display: grid; place-items: center; cursor: pointer; transition: all .12s; flex: none; color: transparent;
}
.row-check:hover { border-color: var(--gold); }
.row-check.on { background: var(--gold); border-color: var(--gold); color: #04241d; }
.row-check svg { width: 12px; height: 12px; }
table.leads tbody tr.sel { background: var(--gold-soft); }
table.leads tbody tr.sel:hover { background: color-mix(in srgb, var(--gold) 20%, transparent); }

.bulkbar {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 120;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; max-width: calc(100vw - 32px);
  background: var(--surface-3); border: 1px solid var(--line-2); border-radius: 14px;
  padding: 9px 11px; box-shadow: var(--shadow); animation: rise .2s cubic-bezier(.2,.8,.2,1) both;
}
.bulkbar__count { font-weight: 700; font-size: 13px; padding: 0 6px; white-space: nowrap; }
.bulkbar__sep { width: 1px; height: 22px; background: var(--line-2); }
.bulkbar .select { padding: 6px 9px; font-size: 12px; width: auto; min-width: 92px; }
.bulkbar .btn { white-space: nowrap; }

.empty { text-align: center; padding: 60px 20px; color: var(--dim); }
.empty svg { width: 40px; height: 40px; opacity: .4; margin-bottom: 12px; }
.empty h3 { font-size: 16px; color: var(--muted); margin-bottom: 6px; }

/* ============================ Kanban ================================== */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: 268px; gap: 14px; overflow-x: auto; padding-bottom: 14px; }
.col { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100dvh - 200px); }
.col__head { display: flex; align-items: center; gap: 8px; padding: 13px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.col__head .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); }
.col__head b { font-size: 13px; font-weight: 600; }
.col__head .count { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--dim); }
.col__head .sum { font-family: var(--font-mono); font-size: 10.5px; color: var(--dim); width: 100%; padding: 0 0 0 16px; }
.col__body { padding: 10px; display: flex; flex-direction: column; gap: 9px; overflow-y: auto; flex: 1; min-height: 60px; }
.col.drop { outline: 1px dashed var(--gold-line); outline-offset: -3px; background: rgba(31,224,192,.03); }
.kcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px;
  cursor: grab; transition: border-color .15s, transform .1s, box-shadow .15s; border-left: 3px solid var(--c, var(--gold));
}
.kcard:hover { border-color: var(--line-2); box-shadow: var(--shadow-s); }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: .4; }
.kcard__top { display: flex; justify-content: space-between; align-items: start; gap: 8px; margin-bottom: 8px; }
.kcard__name { font-weight: 600; font-size: 13px; }
.kcard__co { color: var(--dim); font-size: 11.5px; margin-top: 1px; }
.kcard__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }

/* ============================ Charts ================================== */
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut { flex: none; }
.legend { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.legend__row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.legend__row .dot { width: 9px; height: 9px; border-radius: 3px; background: var(--c); flex: none; }
.legend__row .lg-name { text-transform: capitalize; color: var(--muted); }
.legend__row .lg-val { margin-left: auto; font-family: var(--font-mono); font-weight: 700; }
.legend__row .lg-bar { flex: 1; height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; max-width: 90px; }
.legend__row .lg-bar > i { display: block; height: 100%; background: var(--c); border-radius: 3px; }

.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel__row { display: grid; grid-template-columns: 90px 1fr 40px; align-items: center; gap: 12px; }
.funnel__label { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.funnel__track { height: 26px; background: var(--surface-2); border-radius: 7px; overflow: hidden; }
.funnel__fill { height: 100%; border-radius: 7px; background: linear-gradient(90deg, var(--acc-green), var(--acc-cyan)); display: flex; align-items: center; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.funnel__num { font-family: var(--font-mono); font-weight: 700; font-size: 13px; text-align: right; }

/* ============================ Activity feed / timeline ================ */
.feed { display: flex; flex-direction: column; }
.feed__row { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.feed__row:last-child { border-bottom: none; }
.feed__ic { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.feed__ic svg { width: 15px; height: 15px; }
.feed__body { min-width: 0; font-size: 13px; }
.feed__body .t { color: var(--dim); font-size: 11px; font-family: var(--font-mono); margin-top: 2px; }

.timeline { display: flex; flex-direction: column; gap: 0; position: relative; }
.tl { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.tl::before { content: ''; position: absolute; left: 14px; top: 30px; bottom: -2px; width: 1px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl__ic { width: 29px; height: 29px; border-radius: 9px; flex: none; display: grid; place-items: center; z-index: 1; background: var(--surface-2); color: var(--gold); border: 1px solid var(--line); }
.tl__ic svg { width: 14px; height: 14px; }
.tl__body { padding-top: 3px; font-size: 13px; }
.tl__body .t { color: var(--dim); font-family: var(--font-mono); font-size: 11px; margin-top: 3px; }

/* ============================ Follow-ups =============================== */
.fu-group { margin-bottom: 22px; }
.fu-group__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.fu-group__head h3 { font-size: 14px; }
.fu-group__head .pill { font-family: var(--font-mono); font-size: 11px; padding: 2px 9px; border-radius: 100px; background: var(--surface-2); color: var(--muted); }
.fu-group.overdue .fu-group__head h3 { color: var(--red); }
.fu-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-s); margin-bottom: 8px; transition: border-color .15s;
}
.fu-item:hover { border-color: var(--line-2); }
.fu-item.overdue { border-left: 3px solid var(--red); }
.fu-check { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); flex: none; cursor: pointer; display: grid; place-items: center; transition: all .15s; }
.fu-check:hover { border-color: var(--gold); }
.fu-check.done { background: var(--green); border-color: var(--green); color: #06210f; }
.fu-item__body { flex: 1; min-width: 0; }
.fu-item__title { font-weight: 600; font-size: 13.5px; }
.fu-item.done .fu-item__title { text-decoration: line-through; color: var(--dim); }
.fu-item__meta { color: var(--dim); font-size: 12px; margin-top: 2px; }
.fu-due { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.fu-due.overdue { color: var(--red); }

/* ============================ Modal / drawer ========================== */
.overlay { position: fixed; inset: 0; z-index: 200; background: rgba(4,5,7,.6); backdrop-filter: blur(3px); opacity: 0; animation: fade .2s forwards; }
.overlay[hidden] { display: none; }

.modal {
  position: fixed; z-index: 210; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(680px, calc(100vw - 40px)); max-height: calc(100dvh - 60px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-l);
  box-shadow: var(--shadow); animation: pop .25s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes pop { from { opacity: 0; transform: translate(-50%,-46%) scale(.97) } to { opacity: 1; transform: translate(-50%,-50%) scale(1) } }
.modal__head { display: flex; align-items: center; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal__head h2 { font-size: 18px; }
.modal__head .x { margin-left: auto; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }
.modal__head .x:hover { color: var(--text); background: var(--surface-3); }
.modal__body { padding: 22px 24px; }
.modal__foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }

/* Drawer (lead detail) */
.drawer {
  position: fixed; z-index: 210; top: 0; right: 0; height: 100dvh; width: min(500px, 100vw);
  background: var(--surface); border-left: 1px solid var(--line-2); box-shadow: var(--shadow);
  display: flex; flex-direction: column; animation: slidein .3s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes slidein { from { transform: translateX(100%) } to { transform: none } }
.drawer__head { padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.drawer__top { display: flex; align-items: start; gap: 12px; }
.drawer__top .x { margin-left: auto; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.drawer__top .x:hover { color: var(--text); }
.drawer h2 { font-size: 20px; }
.drawer__co { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.drawer__badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.drawer__body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.drawer__tabs { display: flex; gap: 4px; padding: 0 24px; border-bottom: 1px solid var(--line); }
.drawer__tab { padding: 12px 12px; background: none; border: none; color: var(--dim); font-weight: 600; font-size: 13px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.drawer__tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.dl { display: grid; grid-template-columns: 120px 1fr; gap: 12px 14px; font-size: 13.5px; }
.dl dt { color: var(--dim); }
.dl dd { margin: 0; font-weight: 500; }
.dl dd a { color: var(--linkedin); text-decoration: none; }
.dl dd a:hover { text-decoration: underline; }

.stage-track { display: flex; gap: 4px; margin: 4px 0 20px; }
.stage-track button {
  flex: 1; padding: 8px 4px; font-size: 10.5px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .04em;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--dim); border-radius: 6px; transition: all .15s;
}
.stage-track button:hover { color: var(--text); border-color: var(--line-2); }
.stage-track button.on { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold); }
.stage-track button.done { color: var(--muted); }

.add-note { display: flex; gap: 8px; margin-bottom: 18px; }
.add-note input { flex: 1; }

/* ============================ Import =================================== */
.dropzone {
  border: 1.5px dashed var(--line-2); border-radius: var(--radius); padding: 40px; text-align: center;
  transition: all .15s; cursor: pointer; background: var(--bg-2);
}
.dropzone:hover, .dropzone.drag { border-color: var(--gold-line); background: rgba(31,224,192,.03); }
.dropzone svg { width: 36px; height: 36px; color: var(--gold); margin-bottom: 12px; }
.dropzone h3 { font-size: 16px; margin-bottom: 6px; }
.dropzone p { color: var(--dim); font-size: 13px; }
.preview-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 8px; }
.preview-table th { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; color: var(--dim); }
.preview-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }
.pager__info { font-family: var(--font-mono); font-size: 12px; color: var(--muted); min-width: 110px; text-align: center; }
.btn[disabled] { opacity: .4; pointer-events: none; }

/* ============================ Toast =================================== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  z-index: 400; background: var(--surface-3); border: 1px solid var(--line-2); color: var(--text);
  padding: 12px 18px; border-radius: 100px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow);
  opacity: 0; transition: opacity .25s, transform .25s; display: flex; align-items: center; gap: 9px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.toast.err::before { background: var(--red); }

/* ============================ Misc ==================================== */
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.mono { font-family: var(--font-mono); }
.right { text-align: right; }
.tag { display: inline-block; font-size: 11px; font-family: var(--font-mono); color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); padding: 2px 8px; border-radius: 6px; margin: 0 4px 4px 0; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-2); border-top-color: var(--gold); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
.center-load { display: grid; place-items: center; padding: 80px; }

/* ============================ Responsive ============================== */
@media (max-width: 1080px) { .kpis { grid-template-columns: repeat(2, 1fr); } .two-col { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .app-root { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 100; left: 0; top: 0; width: 240px; transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: none; }
  .topbar__title h1 { font-size: 18px; }
  .search { width: 160px; } .search:focus-within { width: 200px; }
  .view { padding: 20px 16px 50px; }
  .form-grid { grid-template-columns: 1fr; }
}
/* theme toggle */
.theme-toggle {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); border-radius: 10px;
  transition: color .15s, background .15s, border-color .15s;
}
.theme-toggle:hover { color: var(--gold); border-color: var(--gold-line); background: var(--gold-soft); }
.theme-toggle .ic-moon { display: none; }
.theme-toggle .ic-sun  { display: inline-grid; place-items: center; }
:root[data-theme="light"] .theme-toggle .ic-sun  { display: none; }
:root[data-theme="light"] .theme-toggle .ic-moon { display: inline-grid; place-items: center; }
/* login-screen toggle sits top-right */
.login__toggle { position: absolute; top: 22px; right: 24px; z-index: 3; }

.menu-btn { display: none; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); width: 36px; height: 36px; border-radius: 9px; place-items: center; }
@media (max-width: 860px) { .menu-btn { display: grid; } }
