/* ============================================================
   Sellution — Lead Management module
   Fresh Leads · User Pots · Lead Pots · Lead Rules (automations) · Analytics
   Mimics the real product (dark product nav + light content).
   ============================================================ */

.lm { display: flex; flex-direction: column; }
/* dark product nav strip (matches the real app) */
.lm-nav { display: flex; align-items: center; gap: 2px; background: #0f1d33; padding: 0 10px; overflow-x: auto; }
.lm-nav-btn { border: 0; background: none; color: rgba(255,255,255,0.62); font-family: var(--font-body); font-weight: 600; font-size: 0.86rem; padding: 14px 14px; cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; transition: color 0.16s, border-color 0.16s; display: inline-flex; align-items: center; gap: 7px; }
.lm-nav-btn svg { width: 15px; height: 15px; }
.lm-nav-btn:hover { color: #fff; }
.lm-nav-btn.on { color: #fff; border-bottom-color: var(--accent); }
.lm-nav-btn .lm-pill { font-family: var(--font-mono); font-size: 0.64rem; background: rgba(255,255,255,0.14); color: #fff; border-radius: 999px; padding: 1px 7px; }

.lm-body { padding: 24px 26px; background: var(--bg-2); min-height: 480px; }
@media (max-width: 560px) { .lm-body { padding: 18px; } }
.lm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.lm-title { font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; letter-spacing: -0.02em; color: var(--ink); }
.lm-sub { font-size: 0.86rem; color: var(--muted); margin-top: 3px; }
.lm-act { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 10px; padding: 11px 17px; font-family: var(--font-body); font-weight: 700; font-size: 0.88rem; cursor: pointer; transition: transform 0.16s var(--ease), background 0.16s, filter 0.16s; }
.lm-act svg { width: 15px; height: 15px; }
.lm-act.primary { background: var(--primary); color: #fff; }
.lm-act.primary:hover:not(:disabled) { transform: translateY(-2px); background: var(--primary-2); }
.lm-act.primary:disabled { opacity: 0.55; cursor: default; }
.lm-act.gold { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #3a2600; }
.lm-act.gold:hover { transform: translateY(-2px); }

/* snapshot cards */
.lm-snap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
@media (max-width: 720px) { .lm-snap { grid-template-columns: 1fr 1fr; } }
.lm-snapcard { border: 1px solid var(--line); border-radius: 13px; background: #fff; padding: 15px; display: flex; align-items: center; gap: 12px; }
.lm-snapcard .si { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.lm-snapcard .si svg { width: 19px; height: 19px; }
.lm-snapcard .sk { font-size: 0.72rem; color: var(--muted); }
.lm-snapcard .sv { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; color: var(--ink); letter-spacing: -0.02em; line-height: 1.1; }
.lm-snapcard .sv small { font-size: 0.8rem; color: var(--muted); font-weight: 600; }

/* integrations row */
.lm-integ-h { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 4px 0 12px; display: flex; align-items: center; gap: 8px; }
.lm-integ-h svg { width: 14px; height: 14px; flex-shrink: 0; }
.lm-integ { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.lm-source { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 11px 15px; }
.lm-source .lsrc-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex-shrink: 0; font-weight: 800; font-size: 0.7rem; }
.lm-source .lsrc-ic svg { width: 17px; height: 17px; }
.lm-source .lsrc-name { font-weight: 700; font-size: 0.84rem; color: var(--ink); }
.lm-source .lsrc-meta { font-size: 0.72rem; color: var(--muted); }
.lm-source .lsrc-live { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: pulse 1.6s infinite; }
.lm-source.off { opacity: 0.55; }
.lm-source.off .lsrc-live { background: var(--muted-2); animation: none; }

/* generic data table */
.lm-table { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.lm-trow { display: grid; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.lm-trow:last-child { border-bottom: 0; }
.lm-trow.head { background: var(--bg-2); font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-2); }
.lm-fresh-cols { grid-template-columns: 1.3fr 1.6fr 1fr 1.2fr; }
.lm-cell-name { font-weight: 700; font-size: 0.88rem; color: var(--ink); }
.lm-cell { font-size: 0.84rem; color: var(--body); }
.lm-cell-mono { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }
.lm-owner { display: inline-flex; align-items: center; gap: 7px; font-size: 0.82rem; font-weight: 600; }
.lm-owner .oav { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 0.62rem; font-weight: 800; }
.lm-owner.public { color: var(--muted); }
.lm-owner.assigned { color: var(--ink); }
.lm-trow.justassigned { animation: lmFlash 0.7s var(--ease); }
@keyframes lmFlash { 0% { background: var(--ok-soft); } 100% { background: #fff; } }
.lm-srctag { font-size: 0.66rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }

/* user pots: stat tiles */
.lm-potcard { border: 1px solid var(--line); border-radius: 16px; background: #fff; padding: 18px; }
.lm-pot-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.lm-pot-av { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg,#12a06a,#0a7d50); color: #fff; display: grid; place-items: center; font-weight: 800; }
.lm-pot-name { font-weight: 800; font-size: 1.1rem; color: var(--ink); }
.lm-pot-role { font-size: 0.8rem; color: var(--muted); }
.lm-pot-actions { margin-left: auto; display: flex; gap: 8px; }
.lm-mini { border: 1px solid var(--line-2); background: #fff; border-radius: 9px; padding: 8px 13px; font-family: var(--font-body); font-weight: 600; font-size: 0.82rem; color: var(--ink); cursor: pointer; transition: all 0.16s var(--ease); }
.lm-mini:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.lm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
@media (max-width: 820px) { .lm-stats { grid-template-columns: repeat(2, 1fr); } }
.lm-stat { background: #fff; padding: 15px; }
.lm-stat.tinted { background: linear-gradient(180deg,#fffdf6,#fff); }
.lm-stat .lk { font-size: 0.74rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.lm-stat .lk svg { width: 13px; height: 13px; opacity: 0.7; }
.lm-stat .lv { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--ink); margin-top: 5px; letter-spacing: -0.02em; line-height: 1; }
.lm-stat .ld { font-size: 0.72rem; color: var(--muted-2); margin-top: 4px; }
.lm-stat .lv.roi { color: var(--ok); }
.lm-pot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
@media (max-width: 760px) { .lm-pot-grid { grid-template-columns: 1fr; } }
.lm-insight { border: 1px solid var(--line); border-radius: 13px; background: #fff; padding: 16px; }
.lm-insight h5 { margin: 0 0 10px; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.lm-insight h5 svg { width: 14px; height: 14px; }
.lm-outcome { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.lm-outcome .ob { flex: 1; height: 8px; border-radius: 5px; background: var(--bg-2); overflow: hidden; }
.lm-outcome .ob i { display: block; height: 100%; border-radius: 5px; width: 0; transition: width 0.7s var(--ease); }
.lm-outcome .oname { font-size: 0.8rem; color: var(--ink); min-width: 92px; }
.lm-outcome .oval { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); min-width: 34px; text-align: right; }
.lm-consume { display: flex; gap: 16px; }
.lm-consume .cc-big { font-family: var(--font-display); font-weight: 800; font-size: 2rem; letter-spacing: -0.02em; }
.lm-consume .cc-big.purple { color: #7c3aed; }
.lm-cons-rows { display: flex; gap: 14px; margin-top: 6px; }
.lm-cons-rows .cr { font-size: 0.78rem; }
.lm-cons-rows .cr b { display: block; font-family: var(--font-display); font-size: 1.05rem; }
.lm-cons-rows .cr.neg b { color: #d4533a; } .lm-cons-rows .cr.negu b { color: var(--gold); } .lm-cons-rows .cr.pos b { color: var(--ok); }

/* lead pots board */
.lm-pots-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 820px) { .lm-pots-board { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .lm-pots-board { grid-template-columns: 1fr; } }
.lm-pot-col { border: 1px solid var(--line); border-radius: 14px; background: #fff; display: flex; flex-direction: column; min-height: 150px; transition: border-color 0.16s, box-shadow 0.16s, background 0.16s; }
.lm-pot-col.drop { border-color: var(--primary); border-style: dashed; background: var(--primary-soft); }
.lm-pot-col.recycle.drop { border-color: var(--gold); background: var(--accent-soft); }
.lm-pot-colh { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.lm-pot-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.lm-pot-coln { font-weight: 700; font-size: 0.88rem; color: var(--ink); }
.lm-pot-cnt { margin-left: auto; font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); background: var(--bg-2); border-radius: 999px; padding: 2px 9px; }
.lm-pot-list { padding: 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.lm-lead-chip { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 9px 11px; cursor: grab; box-shadow: var(--shadow-sm); transition: box-shadow 0.16s, transform 0.16s var(--ease); }
.lm-lead-chip:hover { box-shadow: var(--shadow-md); }
.lm-lead-chip.dragging { opacity: 0.4; cursor: grabbing; }
.lm-lead-chip.moved { animation: widgetPop 0.4s var(--ease); }
.lm-lead-chip .lc-name { font-weight: 700; font-size: 0.82rem; color: var(--ink); }
.lm-lead-chip .lc-meta { font-size: 0.72rem; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.lm-pot-hint { font-size: 0.84rem; color: var(--muted); margin: 0 0 14px; display: flex; align-items: center; gap: 9px; }
.lm-pot-hint svg { width: 16px; height: 16px; color: var(--primary); flex-shrink: 0; }
.lm-sim-sub svg { width: 14px; height: 14px; }

/* rules + automations */
.lm-rule-cat { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 6px 0 12px; display: flex; align-items: center; gap: 8px; }
.lm-rule-cat svg { width: 14px; height: 14px; flex-shrink: 0; }
.lm-rule { display: flex; align-items: flex-start; gap: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; padding: 16px 18px; margin-bottom: 11px; }
.lm-rule.on { border-color: rgba(57,83,165,0.35); }
.lm-rule-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; background: var(--primary-soft); color: var(--primary); }
.lm-rule-ic.amber { background: var(--accent-soft); color: var(--gold); }
.lm-rule-ic svg { width: 19px; height: 19px; }
.lm-rule-main { flex: 1; min-width: 0; }
.lm-rule-t { font-weight: 700; font-size: 0.95rem; color: var(--ink); }
.lm-rule-d { font-size: 0.84rem; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.lm-rule-d b { color: var(--ink); font-weight: 700; }
.lm-rule-edit { display: inline-flex; align-items: center; gap: 8px; margin-top: 9px; font-size: 0.8rem; }
.lm-rule-edit input[type=number] { width: 54px; border: 1px solid var(--line-2); border-radius: 7px; padding: 5px 8px; font-family: var(--font-mono); font-size: 0.82rem; text-align: center; color: var(--ink); }
.lm-rule-edit .pill { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); background: var(--bg-2); border-radius: 7px; padding: 4px 9px; }
/* toggle */
.lm-toggle { width: 42px; height: 24px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; flex-shrink: 0; border: 0; transition: background 0.2s; margin-top: 2px; }
.lm-toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform 0.2s var(--ease); }
.lm-toggle.on { background: var(--ok); }
.lm-toggle.on::after { transform: translateX(18px); }

/* recycling simulator */
.lm-sim { border: 1px solid rgba(251,169,25,0.4); background: linear-gradient(180deg,#fffdf6,#fff); border-radius: 14px; padding: 18px; margin-top: 18px; }
.lm-sim-h { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 0.92rem; color: var(--ink); margin-bottom: 4px; }
.lm-sim-h svg { width: 17px; height: 17px; color: var(--gold); }
.lm-sim-sub { font-size: 0.82rem; color: var(--muted); margin-bottom: 16px; }
.lm-sim-card { display: flex; align-items: center; gap: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 15px 18px; flex-wrap: wrap; }
.lm-sim-lead { display: flex; align-items: center; gap: 11px; }
.lm-sim-av { width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 0.82rem; }
.lm-sim-name { font-weight: 700; font-size: 0.92rem; color: var(--ink); white-space: nowrap; }
.lm-sim-lead { flex-shrink: 0; }
.lm-sim-pot { font-size: 0.76rem; color: var(--muted); margin-top: 1px; }
.lm-sim-pot b { color: var(--primary); font-weight: 700; }
.lm-sim-pot b.recycle { color: var(--gold); }
.lm-pips { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
#simPips { display: inline-flex; align-items: center; gap: 7px; }
.lm-pip { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; transition: all 0.25s var(--ease); }
.lm-pip svg { width: 11px; height: 11px; color: #fff; opacity: 0; }
.lm-pip.lit { background: #d4533a; border-color: #d4533a; }
.lm-pip.lit svg { opacity: 1; }
.lm-pips-label { font-size: 0.74rem; color: var(--muted); margin-right: 4px; }
.lm-sim-btns { display: flex; gap: 9px; margin-left: auto; flex-wrap: wrap; }
.lm-sim-btn { border: 1px solid var(--line-2); background: #fff; border-radius: 9px; padding: 9px 14px; font-family: var(--font-body); font-weight: 700; font-size: 0.82rem; color: var(--ink); cursor: pointer; transition: all 0.16s var(--ease); display: inline-flex; align-items: center; gap: 7px; }
.lm-sim-btn svg { width: 14px; height: 14px; }
.lm-sim-btn.no:hover { border-color: #d4533a; color: #d4533a; transform: translateY(-1px); }
.lm-sim-btn.reset:hover { border-color: var(--ink); }
.lm-sim-toast { margin-top: 14px; display: none; align-items: center; gap: 10px; background: var(--accent-soft); border: 1px solid rgba(251,169,25,0.4); border-radius: 11px; padding: 12px 15px; font-size: 0.86rem; color: var(--gold); font-weight: 600; animation: msgIn 0.4s var(--ease); }
.lm-sim-toast.show { display: flex; }
.lm-sim-toast svg { width: 17px; height: 17px; flex-shrink: 0; }

/* analytics: lead source table + data age */
.lm-an-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.lm-src-cols { grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr; }
.lm-src-cols .r { text-align: right; }
.lm-an-card { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 18px; }
.lm-an-card h4 { margin: 0 0 14px; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.lm-an-card h4 svg { width: 15px; height: 15px; }
.lm-age-row { display: grid; grid-template-columns: 64px 1fr 70px; gap: 12px; align-items: center; margin-bottom: 10px; }
.lm-age-lab { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--ink); font-weight: 600; }
.lm-age-dot { width: 9px; height: 9px; border-radius: 50%; }
.lm-age-track { height: 12px; border-radius: 7px; background: var(--bg-2); overflow: hidden; }
.lm-age-track i { display: block; height: 100%; border-radius: 7px; width: 0; transition: width 0.8s var(--ease); }
.lm-age-val { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); text-align: right; }
.lm-an-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 680px) { .lm-an-metrics { grid-template-columns: 1fr 1fr; } }

@media (prefers-reduced-motion: reduce) {
  .lm-source .lsrc-live, .lm-sim-pot b { animation: none !important; }
  .lm-outcome .ob i, .lm-age-track i { transition: none !important; }
}
