/* ===== Manage Leads Page ===== */
.ml-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  flex-wrap:wrap;
  margin-bottom: 10px;
}
.ml-title{
  font-size: 18px;
  font-weight: 900;
  margin: 0 0 8px 0;
}
.ml-chips{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border:1px solid #e6e9f2;
  border-radius:999px;
  background:#fff;
  font-size:12px;
  font-weight:700;
  color:#374151;
  text-decoration:none;
}
.chip i{ color:#60a5fa; }

.ml-head-right{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.pill{
  border:1px solid #e6e9f2;
  background:#fff;
  border-radius:999px;
  padding:6px 12px;
  font-size:12px;
  font-weight:800;
  color:#374151;
}
.pill .pill-val{
  font-weight:900;
  color:#111827;
}

/* Tabs bar */
.ml-tabs-bar{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:10px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 12px;
}
.ml-tabs{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}
.ml-tab{
  border:0;
  background:transparent;
  font-size:12px;
  font-weight:800;
  color:#6b7280;
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
}
.ml-tab .dot{
  width:12px;height:12px;border-radius:50%;
  border:2px solid #cbd5e1;
  display:inline-block;
}
.ml-tab.active{
  background:#eef6ff;
  color:#2563eb;
}
.ml-tab.active .dot{
  border-color:#2563eb;
  background:#2563eb;
}
.ml-view{ display:flex; gap:8px; }
.view-btn{
  width:34px;height:34px;
  border-radius:10px;
  border:1px solid #e6e9f2;
  background:#fff;
  display:grid;
  place-items:center;
  color:#6b7280;
}
.view-btn.active{
  background:#2563eb;
  border-color:#2563eb;
  color:#fff;
}

/* Lead big card */
.lead-card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  box-shadow: 0 1px 0 rgba(16,24,40,.02), 0 12px 30px rgba(16,24,40,.06);
  display:grid;
  grid-template-columns: 1fr 260px 280px;
  overflow:hidden;
}

.lead-main{ padding:14px; }
.lead-mid{
  border-left:1px solid #eef2f7;
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.lead-from{
  border-left:1px solid #eef2f7;
  padding:0;
  display:flex;
  flex-direction:column;
}
.from-head{
  padding:12px 14px;
  border-bottom:1px solid #eef2f7;
}
.from-title{ font-weight:900; font-size:12px; color:#374151; }
.from-body{
  padding:12px 14px;
  font-size:12px;
}
.from-name{
  display:inline-block;
  font-weight:900;
  color:#2563eb;
  text-decoration:none;
  margin-bottom: 8px;
}
.from-line{ margin: 4px 0; color:#374151; }
.from-line span{ color:#6b7280; font-weight:800; }
.from-icons{
  display:flex;
  gap:8px;
  margin-top: 12px;
  flex-wrap:wrap;
}
.mini-ico{
  width:34px;height:34px;
  border:1px solid #e6e9f2;
  border-radius:10px;
  background:#fff;
  color:#2563eb;
  display:grid;place-items:center;
}

/* Top meta row */
.lead-meta{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.meta-item{
  min-width: 90px;
}
.meta-label{
  font-size:11px;
  font-weight:900;
  color:#374151;
}
.meta-val{
  font-size:11px;
  color:#6b7280;
  font-weight:700;
  margin-top:2px;
}
.meta-actions{
  margin-left:auto;
  display:flex;
  gap:8px;
}
.i-soft{
  width:32px;height:32px;
  border-radius:10px;
  border:1px solid #eef2f7;
  background:#fff;
  display:grid;
  place-items:center;
  color:#9aa3af;
}

/* Title / tags */
.lead-title{
  margin-top: 10px;
  font-size:14px;
  font-weight:950;
  color:#2563eb;
}
.lead-sub{
  font-size:12px;
  color:#6b7280;
  font-weight:700;
}

.lead-tags{
  margin-top:10px;
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.tag{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border:1px solid #dbeafe;
  background:#eef6ff;
  color:#2563eb;
  font-weight:900;
  border-radius:999px;
  font-size:11px;
}

/* Stage progress line */
.stage-track{
  margin-top: 12px;
  position:relative;
  padding-top: 4px;
}
.stage-point{
  width:18px;height:18px;
  border-radius:50%;
  border:2px solid #cbd5e1;
  background:#fff;
  display:grid;
  place-items:center;
  color:#fff;
  font-size:10px;
  position:absolute;
  top: 0;
}
.stage-point.done{
  border-color:#22c55e;
  background:#22c55e;
}
.stage-point.current{
  border-color:#22c55e;
  background:#22c55e;
}
.stage-line{
  height:3px;
  background:#cbd5e1;
  position:absolute;
  top: 8px;
  left: 18px;
  right: 18px;
}
.stage-line.done{
  background:#22c55e;
}

.stage-point:nth-child(1){ left:0; }
.stage-point:nth-child(3){ left:45%; transform:translateX(-50%); }
.stage-point:nth-child(5){ right:0; }

.stage-labels{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  margin-top: 18px;
  font-size:10px;
  font-weight:900;
  color:#6b7280;
}
.stage-labels .sl:nth-child(1){ text-align:left; }
.stage-labels .sl:nth-child(2){ text-align:center; }
.stage-labels .sl:nth-child(3){ text-align:right; }

.lead-mini-actions{ margin-top: 10px; }

/* Bottom info row */
.lead-bottom{
  margin-top: 10px;
  border-top:1px solid #eef2f7;
  padding-top:10px;
  display:grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr)) 220px;
  gap:10px;
  align-items:center;
}
.lb-label{
  font-size:10px;
  font-weight:900;
  color:#374151;
}
.lb-val{
  font-size:11px;
  font-weight:700;
  color:#6b7280;
  margin-top:2px;
}
.lb-val.hot{
  color:#f97316;
  font-weight:900;
}

.lb-right-icons{
  justify-self:end;
  display:flex;
  gap:8px;
}
.lb-ico{
  width:38px;height:38px;
  border:1px solid #eef2f7;
  border-radius:12px;
  background:#fff;
  display:grid;
  place-items:center;
  color:#2563eb;
}
.lb-ico:nth-child(2){ color:#22c55e; } /* WhatsApp green */

/* mid column */
.mid-top{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.mid-chips{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:auto;
}
.chip-lite{
  padding:6px 10px;
  border:1px solid #e6e9f2;
  border-radius:999px;
  background:#fff;
  font-size:11px;
  font-weight:800;
  color:#6b7280;
}
.mid-ctas{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* Footer */
.ml-footer{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-top: 12px;
  flex-wrap:wrap;
}

/* Responsive */
@media (max-width: 1200px){
  .lead-card{
    grid-template-columns: 1fr;
  }
  .lead-mid, .lead-from{ border-left:0; border-top:1px solid #eef2f7; }
  .lead-bottom{
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
  .lb-right-icons{ justify-self:start; }
}

/* Lead Search Filter Modal */
.lsf-modal{
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e8eef7;
  box-shadow: 0 20px 50px rgba(0,0,0,.18);
}

.lsf-header{
  background:#fff;
  border-bottom: 1px solid #eef2f7;
  padding: 14px 16px;
}
.lsf-header .modal-title{
  font-weight: 700;
  color:#1f2a44;
}

.lsf-body{
  padding: 14px 16px 10px;
}

.lsf-hr{
  margin: 12px 0;
  border-color:#eef2f7;
  opacity:1;
}

.lsf-row{
  display:grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items:center;
}
.lsf-row.align-start{ align-items:flex-start; }

.lsf-label{
  font-size: 13px;
  color:#334155;
  font-weight:600;
}

.lsf-controls{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.lsf-controls.column{ flex-direction:column; align-items:flex-start; }

.lsf-input{ flex:1; min-width: 260px; }
.lsf-select{ width: 140px; }
.lsf-select.wide{ width: 190px; }

.lsf-date{
  display:flex;
  align-items:center;
  gap:8px;
  border:1px solid #e5eaf3;
  padding: 6px 10px;
  border-radius: 10px;
  background:#fff;
}
.lsf-date i{ color:#64748b; }
.lsf-date input{
  border:0 !important;
  padding:0 !important;
  outline: none !important;
  box-shadow:none !important;
  min-width: 140px;
}

.lsf-to{ font-size:13px; color:#64748b; font-weight:600; }

.lsf-radios{
  display:flex;
  gap:14px;
  align-items:center;
  flex-wrap:wrap;
}

.lsf-radio{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  color:#111827;
  cursor:pointer;
  user-select:none;
}
.lsf-radio input{
  width:16px;height:16px;
  accent-color:#4f7cff;
}

.lsf-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 10px 12px;
  width:100%;
  margin-top: 8px;
}
.lsf-grid.status{ grid-template-columns: repeat(3, minmax(150px, 1fr)); }

.lsf-source{ margin-top: 10px; }
.lsf-source-btn{
  border:0;
  background:#4f7cff;
  color:#fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight:700;
  display:inline-flex;
  gap:10px;
  align-items:center;
}
.lsf-source-btn i{ transition:.2s; }
.lsf-source-card{
  border:1px solid #eef2f7;
  border-radius: 12px;
  padding: 12px;
  background:#fbfdff;
}

.lsf-check{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:13px;
  cursor:pointer;
}
.lsf-check input{
  width:16px;height:16px;
  accent-color:#4f7cff;
}

.lsf-footer{
  border-top:1px solid #eef2f7;
  padding: 12px 16px;
  background:#fff;
}

.lsf-reset{
  border-radius: 999px;
  padding: 10px 16px;
}
.lsf-search{
  border-radius: 999px;
  padding: 10px 22px;
  font-weight:700;
}

/* responsive */
@media (max-width: 768px){
  .lsf-row{ grid-template-columns: 1fr; }
  .lsf-select, .lsf-select.wide{ width: 100%; }
  .lsf-input{ min-width: 100%; }
  .lsf-grid{ grid-template-columns: 1fr 1fr; }
}
/* ===== Manage Leads top ===== */
.ml-top{
  display:flex; align-items:center; gap:14px;
  padding:10px 0 14px 0;
}
.ml-title{ margin:0; font-size:22px; font-weight:900; }
.ml-actions{ display:flex; gap:10px; flex-wrap:wrap; }
.ml-chip{
  border:1px solid #e6edf7; background:#fff;
  padding:7px 12px; border-radius:999px;
  font-weight:800; font-size:13px;
  display:flex; align-items:center; gap:8px;
}
.ml-chip i{ color:#4f7cff; }
.ml-right{ margin-left:auto; display:flex; gap:10px; }
.ml-pill{
  border:1px solid #e6edf7; background:#fff;
  padding:7px 12px; border-radius:999px;
  font-size:13px; display:flex; align-items:center;
  font-weight:800;
}

/* Tabs */
.ml-tabs{
  display:flex; gap:12px; align-items:center;
  background:#fff; border:1px solid #e6edf7;
  border-radius:14px; padding:10px 12px;
}
.ml-tab{
  display:flex; align-items:center; gap:8px;
  font-size:13px; font-weight:800; color:#334155;
  padding:6px 10px; border-radius:999px;
  cursor:pointer;
}
.ml-tab input{ display:none; }
.ml-tab.active{ background:#eaf1ff; color:#1d4ed8; }
.ml-iconbtn{
  border:1px solid #e6edf7; background:#fff;
  width:34px; height:34px; border-radius:10px;
}
.ml-iconbtn.active{ background:#4f7cff; color:#fff; border-color:#4f7cff; }

/* Lead card */
.lead-card{
  margin-top:12px;
  background:#fff;
  border:1px solid #e6edf7;
  border-radius:14px;
  overflow:hidden;
}
.lead-card-inner{
  display:grid;
  grid-template-columns: 1fr 360px 260px;
}
.lead-left{ padding:14px; }
.lead-center{ padding:14px; border-left:1px solid #eef2f7; }
.lead-right{ padding:14px; border-left:1px solid #eef2f7; background:#fbfdff; }

.lead-meta{ display:flex; gap:18px; flex-wrap:wrap; }
.lead-meta-col .k{ font-size:11px; color:#64748b; font-weight:900; }
.lead-meta-col .v{ font-size:12px; font-weight:900; color:#111827; }
.lead-meta-col .v.link{ color:#2563eb; cursor:pointer; }
.lead-meta-col.icons i{ margin-right:10px; color:#94a3b8; cursor:pointer; }

.lead-title{ margin-top:12px; font-weight:900; }
.lead-title a{ text-decoration:none; color:#1d4ed8; font-weight:900; }
.lead-sub{ font-size:12px; color:#64748b; font-weight:800; margin-top:4px; }

.lead-row{ margin-top:8px; }

.lead-progress{
  margin-top:12px;
  display:flex; align-items:center; gap:10px;
}
.pstep{ display:flex; flex-direction:column; align-items:center; gap:6px; }
.pstep .dot{ width:18px; height:18px; border-radius:50%; border:2px solid #cbd5e1; }
.pstep.active .dot{ border-color:#22c55e; background:#22c55e; }
.pline{ flex:1; height:3px; background:#e5e7eb; border-radius:99px; }
.pstep small{ font-size:10px; font-weight:900; color:#64748b; }

.lead-bottom{
  margin-top:12px;
  display:grid;
  grid-template-columns: repeat(6, 1fr);
  gap:12px;
  border-top:1px solid #eef2f7;
  padding-top:12px;
}
.info .k{ font-size:11px; color:#64748b; font-weight:900; }
.info .v{ font-size:12px; font-weight:900; }
.info .v.warm{ color:#f97316; }

.lead-top-icons{
  display:flex; align-items:center; gap:10px;
  justify-content:flex-end;
}
.mini{
  border:1px solid #e6edf7;
  background:#fff;
  width:34px; height:34px;
  border-radius:10px;
}
.lead-actions{ margin-top:24px; display:flex; flex-wrap:wrap; gap:10px; justify-content:flex-end; }
.lead-quick-icons{ width:100%; display:flex; gap:10px; justify-content:flex-end; margin-top:10px; }

.from-head{ display:flex; justify-content:space-between; color:#334155; font-weight:900; }
.from-user a{ color:#2563eb; font-weight:900; text-decoration:none; }
.from-lines{ margin-top:10px; font-size:12px; color:#334155; font-weight:700; }
.from-icons{ margin-top:12px; display:flex; gap:10px; flex-wrap:wrap; }
.dealer{ margin-top:12px; font-size:12px; color:#334155; font-weight:800; }
.dealer a{ color:#2563eb; font-weight:900; text-decoration:none; }

.ml-footer-row{
  margin-top:12px;
  display:flex; justify-content:space-between; align-items:center;
}

/* Responsive */
@media(max-width:1200px){
  .lead-card-inner{ grid-template-columns:1fr; }
  .lead-center,.lead-right{ border-left:0; border-top:1px solid #eef2f7; }
  .lead-bottom{ grid-template-columns: repeat(2, 1fr); }
}

/* ===== Add New Lead Popup ===== */
.anl-modal{ border-radius:14px; overflow:hidden; border:0; }
.anl-header{ padding:14px 16px; border-bottom:1px solid #e9eef6; }
.anl-header .modal-title{ font-weight:900; color:#1f2937; }
.anl-body{ padding:16px; }
.anl-info{
  background:#f1f7ff; border:1px solid #b9d2ff; color:#2563eb;
  font-weight:900; border-radius:10px; padding:12px 14px; font-size:14px;
  margin-bottom:16px;
}
.anl-label{ font-weight:900; color:#374151; margin-bottom:8px; }
.anl-input{ border-radius:10px; padding:12px 14px; border:1px solid #e5eaf3; }
.anl-divider{ border-top:1px solid #e9eef6; margin:14px 0; }
.anl-footer{ display:flex; justify-content:center; padding-top:6px; }
.anl-btn{
  background:#4f7cff; color:#fff; border-radius:999px; padding:10px 22px;
  font-weight:900; border:0; box-shadow:0 10px 18px rgba(79,124,255,.18);
}
.anl-btn:hover{ background:#3f6cff; color:#fff; }

/* ===== Lead Filter Popup ===== */
.lf-modal{ border-radius:14px; border:0; overflow:hidden; }
.lf-header{ border-bottom:1px solid #e9eef6; padding:12px 16px; }
.lf-header .modal-title{ font-weight:900; }
.lf-body{ padding:14px 16px; }
.lf-row{ display:grid; grid-template-columns:120px 1fr; gap:12px; align-items:center; }
.lf-label{ font-weight:900; color:#334155; }
.lf-grid{ display:grid; grid-template-columns:1fr 140px; gap:10px; }
.lf-grid-2{ grid-template-columns:1fr 40px 1fr 140px; align-items:center; }
.lf-grid-3{ grid-template-columns:220px 1fr; }
.lf-input, .lf-select{ border-radius:10px; border:1px solid #e5eaf3; font-weight:800; }
.lf-sep{ border-top:1px solid #eef2f7; margin:12px 0; }
.lf-mid{ text-align:center; font-weight:900; color:#64748b; }

.lf-date{ position:relative; }
.lf-date i{ position:absolute; left:12px; top:50%; transform:translateY(-50%); color:#64748b; }
.lf-date input{ padding-left:36px; }

.lf-radio{ display:flex; gap:14px; flex-wrap:wrap; font-weight:800; color:#475569; }
.lf-radio input{ margin-right:6px; }

.lf-stage{ display:flex; flex-direction:column; gap:10px; }
.lf-stage-select{ max-width:180px; }
.lf-stage-grid{
  display:grid; grid-template-columns:repeat(3, minmax(0,1fr));
  gap:10px; font-weight:800; color:#475569;
}
.lf-status-grid{
  display:grid; grid-template-columns:repeat(3, minmax(0,1fr));
  gap:10px; font-weight:800; color:#475569;
}
.lf-source-btn{
  background:#4f7cff; color:#fff; border-radius:10px; font-weight:900;
  padding:10px 14px;
}
.lf-footer{
  display:flex; justify-content:center; gap:12px; margin-top:14px;
}
.lf-reset{
  border:1px solid #e6edf7; background:#fff; border-radius:999px;
  padding:10px 18px; font-weight:900;
}
.lf-search{
  background:#4f7cff; color:#fff; border-radius:999px;
  padding:10px 22px; font-weight:900;
}
