/* The Leads & CRM home — laid out like the approved mockup (sized for a 1536px-wide screen; the dashboard scales itself to the window). */

.cx { --ink: #12163a; --ink2: #4a5272; --mute: #7b819c; --line: #eceef7; --blue: #2a47f5; max-width: 1290px; margin: 0 auto; padding: 6px 0 24px; color: var(--ink); font-family: var(--font-body); }
.cx *, .cx *::before, .cx *::after { box-sizing: border-box; }
.cx h1, .cx h2, .cx h3 { font-family: var(--font-heading); margin: 0; color: var(--ink); }
.cx .ci { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

/* ---- Header: welcome + "how it works" ---- */
.cx-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.cx-welcome { display: flex; align-items: center; gap: 20px; flex: 1; min-width: 420px; padding: 0 0 0 8px; }
.cx-welcome img { width: 82px; height: 82px; flex: none; }
.cx-welcome h1 { font-size: 29px; font-weight: 800; letter-spacing: -0.2px; line-height: 1.15; }
.cx-welcome p { margin: 6px 0 0; font-size: 18px; color: var(--ink2); }
.cx-promo { display: flex; align-items: center; gap: 14px; width: 580px; max-width: 100%; padding: 10px 18px 10px 12px; border-radius: 16px; background: linear-gradient(120deg, #eae8ff 0%, #e7ecff 55%, #eaf0ff 100%); border: 1px solid #e1e4fb; }
.cx-promo img { width: 88px; height: 82px; flex: none; }
.cx-promo p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink2); flex: 1; }
.cx-promo p b { color: var(--ink); font-weight: 700; }
.cx-play { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; padding: 12px 18px; border-radius: 12px; background: #fff; border: 1px solid #dfe3fb; color: var(--blue); font: inherit; font-size: 14.5px; font-weight: 700; text-decoration: none; box-shadow: 0 4px 14px rgba(70, 90, 220, 0.12); }
.cx-play:hover { color: #1b34d6; box-shadow: 0 6px 18px rgba(70, 90, 220, 0.2); }
.cx-play .ci { width: 22px; height: 22px; stroke: none; fill: var(--blue); }
.cx-actions { display: flex; gap: 8px; align-items: center; }

/* ---- Banner ---- */
.cx-banner { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 52px 14px 16px; margin-bottom: 14px; border-radius: 14px; background: linear-gradient(90deg, #fff1d6 0%, #fef6e6 60%, #fff4e0 100%); border: 1px solid #f6e4bf; }
.cx-banner img { width: 32px; height: 32px; flex: none; }
.cx-banner h2 { font-size: 19px; font-weight: 800; }
.cx-banner p { margin: 3px 0 0; font-size: 14.5px; color: #6b6f85; }
.cx-banner button { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: #8a8fa6; cursor: pointer; padding: 6px; border-radius: 8px; }
.cx-banner button:hover { background: rgba(0, 0, 0, 0.05); }

/* ---- Cards & rows ---- */
.cx-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 16px 14px; box-shadow: 0 4px 20px rgba(70, 80, 160, 0.06); min-width: 0; }
.cx-card h2 { font-size: 17px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.cx-card h2 .more { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--blue); text-decoration: none; }
.cx-row1 { display: grid; grid-template-columns: 317fr 295fr 395fr 244fr; gap: 10px; margin-bottom: 12px; }
.cx-row2 { display: grid; grid-template-columns: 950fr 300fr; gap: 12px; margin-bottom: 12px; }

/* Key numbers */
.cx-keys { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cx-key { display: flex; align-items: center; gap: 10px; padding: 12px 10px; border-radius: 13px; border: 1px solid #e8edfb; text-decoration: none; color: inherit; }
.cx-key img { width: 52px; height: 52px; flex: none; }
.cx-key b { display: block; font-family: var(--font-heading); font-size: 25px; line-height: 1.05; font-weight: 800; }
.cx-key span { display: block; margin-top: 3px; font-size: 13.5px; color: var(--ink2); line-height: 1.25; }
.cx-key.k1 { background: linear-gradient(135deg, #f3f8ff, #f8fbff); }
.cx-key.k2 { background: linear-gradient(135deg, #f1fbf7, #f8fdfb); border-color: #e3f4ec; }
.cx-key.k3 { background: linear-gradient(135deg, #f6f3ff, #fbf9ff); border-color: #ece7fb; }
.cx-key.k4 { background: linear-gradient(135deg, #fff6ee, #fffaf5); border-color: #fbe9d9; }

/* Funnel */
.cx-funnel { display: flex; align-items: center; gap: 4px; }
.cx-funnel svg { width: 158px; height: 222px; flex: none; }
.cx-funnel svg text { font-family: var(--font-heading); font-weight: 800; font-size: 18px; fill: #fff; text-anchor: middle; dominant-baseline: central; }
.cx-legend { display: grid; align-content: space-between; height: 214px; padding: 2px 0; }
.cx-legend div { display: flex; align-items: flex-start; gap: 8px; }
.cx-legend i { width: 11px; height: 11px; border-radius: 50%; margin-top: 4px; flex: none; }
.cx-legend b { display: block; font-size: 14px; font-weight: 700; line-height: 1.2; }
.cx-legend small { display: block; font-size: 13px; color: var(--mute); }

/* Trend */
.cx-trend-head { display: flex; align-items: center; margin-bottom: 4px; }
.cx-trend-head h2 { margin: 0; }
.cx-range { margin-left: auto; position: relative; }
.cx-range select { appearance: none; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 7px 28px 7px 12px; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); cursor: pointer; }
.cx-chartkey { display: flex; justify-content: center; gap: 14px; font-size: 12.5px; color: var(--ink2); margin: 2px 0 2px; flex-wrap: wrap; }
.cx-chartkey span { display: inline-flex; align-items: center; gap: 6px; }
.cx-chartkey i { width: 12px; height: 12px; border-radius: 3px; }
.cx-chartkey i.line { height: 3px; width: 18px; border-radius: 2px; background: #5b3df5; position: relative; }
.cx-chartkey i.line::after { content: ""; position: absolute; left: 6px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #5b3df5; }
.cx-chart { width: 100%; height: auto; display: block; overflow: visible; }
.cx-chart text { font-size: 10.5px; fill: #5b6385; }

/* Sources */
.cx-sources { display: grid; gap: 7px; }
.cx-sources div { display: grid; grid-template-columns: 30px 1fr 34px 42px; align-items: center; gap: 6px; font-size: 13.5px; }
.cx-sources img { width: 28px; height: 26px; object-fit: contain; }
.cx-sources .ico { width: 28px; height: 26px; display: inline-flex; align-items: center; justify-content: center; color: var(--blue); }
.cx-sources b { text-align: right; font-weight: 700; }
.cx-sources small { text-align: right; font-size: 13px; color: var(--mute); }
.cx-sources .none { grid-template-columns: 1fr; color: var(--mute); padding: 18px 0; text-align: center; }

/* Pipeline */
.cx-pipe { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.cx-col { min-width: 0; }
.cx-colhead { border-radius: 9px 9px 0 0; padding: 9px 10px; font-size: 14px; font-weight: 700; border: 1px solid var(--bd); background: var(--bg); color: #1f2547; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-colhead span { font-weight: 600; color: #4a5272; }
.cx-cards { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 9px 9px; padding: 6px; display: grid; gap: 5px; min-height: 110px; background: #fff; align-content: start; }
.cx-lead { position: relative; display: flex; align-items: center; gap: 9px; padding: 8px 22px 8px 6px; border-radius: 9px; text-decoration: none; color: inherit; }
a.cx-lead:hover { background: #f6f8ff; }
.cx-lead img, .cx-lead .av { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.cx-lead .av { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 14px; background: var(--a, #6366f1); }
.cx-lead b { display: block; font-size: 14px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-lead small { display: block; font-size: 12px; color: var(--mute); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-lead .dots { position: absolute; right: 4px; top: 10px; color: #8d93ad; font-size: 16px; line-height: 1; letter-spacing: -1px; writing-mode: vertical-rl; }
.cx-lead > div { min-width: 0; }
.cx-emptycol { padding: 22px 6px; text-align: center; color: var(--mute); font-size: 12.5px; }

/* Benefits */
.cx-benefits { display: grid; gap: 11px; }
.cx-benefits div { display: flex; align-items: center; gap: 12px; font-size: 14.5px; line-height: 1.35; color: #2d3354; }
.cx-benefits img { width: 44px; height: 44px; flex: none; }

/* Let's get started */
.cx-start { display: grid; grid-template-columns: 150px 1fr auto; align-items: center; gap: 12px; padding: 14px 20px 14px 14px; border-radius: 16px; background: linear-gradient(100deg, #e9efff 0%, #eef2ff 50%, #f1f4ff 100%); border: 1px solid #e0e6fa; }
.cx-start > img { width: 140px; height: 126px; }
.cx-start h2 { font-size: 20px; font-weight: 800; }
.cx-start p { margin: 4px 0 10px; font-size: 15px; color: var(--ink2); }
.cx-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.cx-step { display: flex; align-items: flex-start; gap: 12px; }
.cx-step > i { width: 40px; height: 40px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; background: #dfe6ff; color: #3345e6; font: normal 800 17px var(--font-heading); box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.55); }
.cx-step b { display: block; font-size: 14px; font-weight: 700; }
.cx-step small { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.45; color: var(--ink2); }
.cx-cta { display: grid; justify-items: center; gap: 12px; }
.cx-cta .big { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 17px 30px; border-radius: 14px; border: 0; background: linear-gradient(135deg, #3b57ff, #2340ee); color: #fff; font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; box-shadow: 0 10px 24px rgba(40, 70, 240, 0.3); white-space: nowrap; }
.cx-cta .big:hover { background: linear-gradient(135deg, #3350f0, #1b34d6); }
.cx-cta .big .ci { width: 20px; height: 20px; stroke-width: 2.4; }
.cx-cta a { font-size: 13.5px; font-weight: 700; color: var(--blue); }

@media (max-width: 1180px) {
  .cx-row1 { grid-template-columns: 1fr 1fr; }
  .cx-row2 { grid-template-columns: 1fr; }
  .cx-start { grid-template-columns: 1fr; justify-items: start; }
  .cx-steps { grid-template-columns: 1fr; }
  .cx-pipe { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) { .cx-row1, .cx-pipe { grid-template-columns: 1fr; } .cx-welcome { min-width: 0; } }

/* ---- Fit tuning against the rendered page ---- */
.cx-keys { gap: 8px; }
.cx-key { padding: 10px 8px; gap: 8px; min-width: 0; overflow: hidden; }
.cx-key img { width: 46px; height: 46px; }
.cx-key > div { min-width: 0; }
.cx-key b { font-size: 22px; }
.cx-key span { font-size: 12.5px; }
.cx-funnel svg { width: 142px; height: 200px; }
.cx-legend { height: 194px; }
.cx-legend b { font-size: 13px; white-space: nowrap; }
.cx-legend small { font-size: 12px; }
.cx-benefits div { font-size: 14px; gap: 10px; }
.cx-benefits img { width: 42px; height: 42px; }
.cx-step small { font-size: 12px; }
.cx-step b { font-size: 13.5px; }
.cx-key span { font-size: 12px; }
.cx-key.k1 span, .cx-key.k2 span, .cx-key.k3 span { white-space: nowrap; }
.cx-cards { grid-template-columns: minmax(0, 1fr); }
.cx-lead { min-width: 0; }
.cx-lead > div { flex: 1; overflow: hidden; }
.cx-range select { padding: 5px 26px 5px 10px; }
.cx-lead { padding-right: 14px; gap: 8px; }
.cx-lead .dots { right: 1px; font-size: 14px; }
.cx-row2 { grid-template-columns: 950fr 300fr; }
.cx-cards { padding: 5px; }
.cx-lead { padding: 7px 10px 7px 4px; gap: 7px; }
.cx-lead img, .cx-lead .av { width: 34px; height: 34px; }
.cx-lead b { font-size: 13.5px; }
.cx-lead small { font-size: 11.5px; }

/* ---- Compact top row (welcome + promo) so the content starts higher ---- */
.cx { padding-top: 0; }
.cx-top { gap: 10px; margin-bottom: 8px; }
.cx-welcome { gap: 12px; min-width: 340px; padding-left: 4px; }
.cx-welcome img { width: 54px; height: 54px; }
.cx-welcome h1 { font-size: 22px; }
.cx-welcome p { margin-top: 2px; font-size: 14px; }
.cx-promo { width: 520px; padding: 6px 12px 6px 8px; gap: 10px; border-radius: 14px; }
.cx-promo img { width: 60px; height: 56px; }
.cx-promo p { font-size: 12.5px; line-height: 1.4; }
.cx-play { padding: 8px 13px; font-size: 13px; border-radius: 10px; gap: 7px; }
.cx-play .ci { width: 18px; height: 18px; }
.cx-banner { padding: 10px 48px 10px 14px; margin-bottom: 10px; border-radius: 12px; }
.cx-banner img { width: 26px; height: 26px; }
.cx-banner h2 { font-size: 16px; }
.cx-banner p { font-size: 13px; margin-top: 1px; }
.cx-row1 { margin-bottom: 10px; }
.cx-row2 { margin-bottom: 10px; }

/* ---- Page title in the header (Welcome to Leads & CRM, with its icon) ---- */
.topbar-heading.has-icon { display: flex; align-items: center; gap: 12px; }
.topbar-heading-text { min-width: 0; flex: 1; }
.topbar-title-icon { width: 40px; height: 40px; flex: none; }

/* ---- Row 1: key numbers + funnel + "how it works" form one block as tall as the trend and sources cards ---- */
.cx-row1 { grid-template-columns: 612fr 395fr 244fr; align-items: stretch; }
.cx-left { display: grid; grid-template-columns: 317fr 295fr; grid-template-rows: 1fr auto; gap: 10px; min-width: 0; }
.cx-left > .cx-card { display: flex; flex-direction: column; }
.cx-left .cx-keys { flex: 1; grid-auto-rows: 1fr; }
.cx-left .cx-funnel { flex: 1; align-items: center; }
.cx-left > .cx-promo { grid-column: 1 / -1; width: auto; max-width: none; padding: 8px 14px 8px 10px; gap: 12px; }
.cx-left > .cx-promo img { width: 64px; height: 60px; }
.cx-left > .cx-promo p { font-size: 13px; }
.cx-bar { display: flex; align-items: center; gap: 12px; margin: 2px 0 10px; flex-wrap: wrap; }
.cx-bar .cx-actions { margin-left: auto; }
.cx-bar .crm-tabs { margin: 0; }
@media (max-width: 1180px) { .cx-row1 { grid-template-columns: 1fr 1fr; } .cx-left { grid-column: 1 / -1; } }
@media (max-width: 640px) { .cx-left { grid-template-columns: 1fr; } }
.cx-row1 > .cx-card { display: flex; flex-direction: column; }
.cx-row1 > .cx-card .cx-chart { flex: 1; }
.cx-row1 > .cx-card .cx-sources { flex: 1; align-content: space-around; }

/* ---- Pipeline header tools ---- */
.cx-card h2 .tools { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.cx-add { display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 10px; padding: 9px 15px; background: linear-gradient(135deg, #3b57ff, #2340ee); color: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: 0 6px 16px rgba(40, 70, 240, 0.25); }
.cx-add:hover { background: linear-gradient(135deg, #3350f0, #1b34d6); }
.cx-add .ci { width: 16px; height: 16px; stroke-width: 2.4; }
.cx-iconlink { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--blue); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.cx-iconlink:hover { background: #eef1ff; border-color: #c9d2fb; }
.cx-more { display: block; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--blue); padding: 6px 0 2px; text-decoration: none; }

/* ---- Empty pipeline columns: ghost cards that show where leads will appear ---- */
.cx-ghosts { display: grid; gap: 8px; padding: 6px 2px 4px; }
.cx-ghosts .ghost { display: flex; align-items: center; gap: 9px; padding: 9px 8px; border: 1.5px dashed color-mix(in srgb, var(--g) 35%, #dfe3f2); border-radius: 10px; background: linear-gradient(135deg, color-mix(in srgb, var(--g) 7%, #fff), #fff); }
.cx-ghosts .ghost.faded { opacity: 0.5; }
.cx-ghosts .ghost i { width: 34px; height: 34px; border-radius: 50%; flex: none; background: color-mix(in srgb, var(--g) 22%, #fff); position: relative; }
.cx-ghosts .ghost i::before { content: ""; position: absolute; left: 11px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: color-mix(in srgb, var(--g) 45%, #fff); }
.cx-ghosts .ghost i::after { content: ""; position: absolute; left: 7px; top: 21px; width: 20px; height: 9px; border-radius: 10px 10px 4px 4px; background: color-mix(in srgb, var(--g) 45%, #fff); }
.cx-ghosts .ghost span { flex: 1; display: grid; gap: 6px; }
.cx-ghosts .ghost u { display: block; height: 7px; border-radius: 4px; background: #e8ebf6; }
.cx-ghosts .ghost u:first-child { width: 72%; background: #dfe3f2; }
.cx-ghosts .ghost u:last-child { width: 48%; }
.cx-ghosts p { margin: 2px 0 0; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--mute); text-align: center; }
.cx-ghosts p .ci { width: 14px; height: 14px; color: var(--g); }

/* ---- Empty sources ---- */
.cx-nodata { flex: 1; display: grid; justify-items: center; align-content: center; gap: 6px; text-align: center; padding: 10px 6px 20px; }
.cx-nodata .art { width: 68px; height: 68px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #6b7cf5; background: radial-gradient(circle at 30% 25%, #f3f5ff, #e3e8ff); box-shadow: 0 0 0 8px #f6f8ff, 0 0 0 16px #fafbff; margin-bottom: 14px; }
.cx-nodata .art .ci { width: 28px; height: 28px; }
.cx-nodata b { font-size: 14.5px; }
.cx-nodata small { font-size: 12.5px; color: var(--mute); max-width: 170px; }

/* ---- Lead sources: sources with no leads yet are greyed out ---- */
.cx-sources .off { opacity: 0.42; filter: grayscale(1); }
.cx-sources-hint { display: block; margin-top: 10px; font-size: 12.5px; color: var(--mute); text-align: center; }

/* ---- Phones: everything stacks, nothing is wider than the screen ---- */
@media (max-width: 640px) {
  .cx { padding: 4px 0 16px; overflow-x: hidden; }
  .cx-top { gap: 10px; }
  .cx-welcome { gap: 12px; min-width: 0; padding: 0; }
  .cx-welcome img { width: 56px; height: 56px; }
  .cx-welcome h1 { font-size: 21px; }
  .cx-welcome p { font-size: 14px; }
  .cx-promo, .cx-left > .cx-promo { width: 100%; flex-wrap: wrap; padding: 10px 12px; }
  .cx-promo img, .cx-left > .cx-promo img { width: 56px; height: 52px; }
  .cx-promo p, .cx-left > .cx-promo p { font-size: 13px; min-width: 150px; }
  .cx-play { width: 100%; justify-content: center; }
  .cx-bar { gap: 8px; }
  .cx-bar .crm-tabs { max-width: 100%; overflow-x: auto; overflow-y: hidden; }
  .cx-bar .crm-tabs a { white-space: nowrap; }
  .cx-bar .cx-actions { margin-left: 0; }
  .cx-card { padding: 14px 12px; }
  .cx-keys { gap: 8px; }
  .cx-key { padding: 10px 8px; gap: 8px; }
  .cx-key img { width: 38px; height: 38px; }
  .cx-key b { font-size: 21px; }
  .cx-key span { font-size: 12.5px; }
  .cx-funnel { flex-wrap: wrap; justify-content: center; gap: 12px; }
  .cx-funnel svg { width: 130px; height: auto; }
  .cx-legend { height: auto; gap: 10px; }
  .cx-card h2 { flex-wrap: wrap; }
  .cx-card h2 .tools { flex-wrap: wrap; }
  .cx-start { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 14px 12px; }
  .cx-start > img { width: 100px; height: 90px; }
  .cx-steps { text-align: left; }
  .cx-cta .big { width: 100%; padding: 14px 18px; font-size: 15px; white-space: normal; }
  .cx-sources div { font-size: 13px; }
  .cx-range select { font-size: 12.5px; }
}

/* ---- Business Benefits drops below the pipeline as a full row whenever the screen is narrower than the full desktop layout ---- */
@media (max-width: 1400px) {
  .cx-row2 { grid-template-columns: 1fr; }
  .cx-benefits { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px 20px; }
}
