/* CRM_LEAD_UI_CONSOLIDATION_V2 */
.follow-kpis{
  display:grid;
  grid-template-columns:repeat(6,minmax(140px,1fr));
  gap:12px;
  margin-bottom:14px
}
.follow-kpis article{
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff;
  padding:15px
}
.follow-kpis article.risk{
  border-color:#efb7bd;
  background:#fff5f5
}
.follow-kpis small{
  display:block;
  color:var(--muted);
  margin-bottom:8px
}
.follow-kpis strong{font-size:24px}
.follow-filter-grid{
  display:grid;
  grid-template-columns:1.2fr repeat(3,minmax(150px,1fr)) auto;
  gap:12px;
  align-items:end;
  margin-top:14px
}
.follow-filter-actions{display:flex;gap:8px}
.follow-table{min-width:1120px}
.follow-table td small,
.follow-subtable td small{
  display:block;
  margin-top:4px;
  color:var(--muted)
}
.follow-overdue td{background:#fff7f7}
.follow-link{
  border:0;
  background:transparent;
  padding:0;
  color:var(--accent);
  font-weight:800
}
.follow-status,
.follow-priority{
  display:inline-flex;
  align-items:center;
  padding:5px 8px;
  border-radius:999px;
  font-size:11px;
  font-weight:800
}
.follow-status.OPEN{background:#eef2ff;color:#3f51a3}
.follow-status.IN_PROGRESS{background:#fff3d8;color:#8b5b00}
.follow-status.COMPLETED{background:#e8f8f1;color:#257a59}
.follow-status.CANCELLED{background:#edf2f7;color:#64748b}
.follow-priority.LOW{background:#edf2f7;color:#64748b}
.follow-priority.NORMAL{background:#eaf2ff;color:#245ba7}
.follow-priority.HIGH{background:#fff3d8;color:#8b5b00}
.follow-priority.URGENT{background:#fdebec;color:var(--bad)}
.bad-text{color:var(--bad)!important;font-weight:800}
.follow-dialog{width:min(820px,calc(100% - 24px))}
.follow-dialog.follow-wide{width:min(1120px,calc(100% - 24px))}
.follow-dialog .modal-card{max-height:calc(100vh - 28px);overflow:auto}
.follow-modal-head{
  display:flex;
  justify-content:space-between;
  gap:18px;
  padding-right:32px;
  margin-bottom:14px
}
.follow-modal-head h3{margin:0;font-size:24px}
.follow-modal-head p{margin:4px 0 0}
.follow-form{display:grid;gap:14px}
.follow-section{
  padding:15px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff;
  margin-top:12px
}
.follow-section-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:13px
}
.follow-section-head span{font-size:12px;color:var(--muted)}
.follow-footer{
  position:sticky;
  bottom:-23px;
  display:flex;
  justify-content:flex-end;
  gap:9px;
  margin:0 -23px -23px;
  padding:14px 23px;
  border-top:1px solid var(--line);
  background:rgba(255,255,255,.96);
  backdrop-filter:blur(12px);
  z-index:5
}
.follow-profile-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap
}
.follow-subtable{min-width:760px}
.follow-timeline{display:grid;gap:0}
.follow-timeline article{
  position:relative;
  display:grid;
  grid-template-columns:18px 1fr;
  gap:12px;
  padding:0 0 20px
}
.follow-timeline article:not(:last-child)::before{
  content:"";
  position:absolute;
  top:13px;
  bottom:0;
  left:6px;
  width:2px;
  background:var(--line)
}
.follow-dot{
  position:relative;
  z-index:1;
  width:14px;
  height:14px;
  margin-top:3px;
  border:3px solid #dbeafe;
  border-radius:50%;
  background:var(--accent)
}
.follow-time-head{
  display:flex;
  justify-content:space-between;
  gap:12px
}
.follow-time-head span,
.follow-timeline small{color:var(--muted)}
.follow-timeline p{margin:7px 0}
.follow-empty{
  display:grid;
  place-items:center;
  min-height:130px;
  gap:5px;
  text-align:center
}

.lead-hub-tabs{
  position:sticky;
  top:0;
  z-index:8;
  display:flex;
  gap:6px;
  margin-bottom:14px;
  padding:7px;
  border:1px solid var(--line);
  border-radius:15px;
  background:rgba(255,255,255,.95);
  backdrop-filter:blur(12px);
  overflow:auto
}
.lead-hub-tabs button{
  flex:0 0 auto;
  border:0;
  border-radius:11px;
  background:transparent;
  padding:10px 14px;
  color:var(--muted);
  font-weight:800
}
.lead-hub-tabs button.active{
  background:var(--accent);
  color:#fff
}
.lead-hub-view-head{margin-bottom:14px}
.lead-pipeline-board{
  display:grid;
  grid-template-columns:repeat(8,minmax(260px,1fr));
  gap:12px;
  overflow-x:auto;
  padding-bottom:12px
}
.lead-pipeline-column{
  min-height:480px;
  border:1px solid var(--line);
  border-radius:17px;
  background:#f7f9fc;
  overflow:hidden
}
.lead-pipeline-column>header{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:14px;
  border-bottom:1px solid var(--line);
  background:#fff
}
.lead-pipeline-column>header small{
  display:block;
  margin-top:3px;
  color:var(--muted)
}
.lead-pipeline-column>header>span{
  font-size:11px;
  color:var(--muted);
  text-align:right
}
.lead-pipeline-cards{
  display:grid;
  align-content:start;
  gap:9px;
  padding:10px
}
.lead-pipeline-card{
  display:grid;
  gap:7px;
  width:100%;
  border:1px solid var(--line);
  border-radius:13px;
  background:#fff;
  padding:12px;
  text-align:left
}
.lead-pipeline-card:hover{
  border-color:var(--accent);
  box-shadow:0 8px 20px rgba(15,23,42,.08)
}
.lead-pipeline-card>small{color:var(--muted)}
.lead-pipeline-card>div{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px
}
.lead-pipeline-empty{
  display:grid;
  place-items:center;
  min-height:90px;
  color:var(--muted);
  font-size:12px
}
.lead-calendar{display:grid;gap:12px}
.lead-calendar-day{
  border:1px solid var(--line);
  border-radius:17px;
  background:#fff;
  overflow:hidden
}
.lead-calendar-day>header{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:12px 15px;
  border-bottom:1px solid var(--line);
  background:#f8fafc
}
.lead-calendar-day>header span{
  color:var(--muted);
  font-size:12px
}
.lead-calendar-day>div{display:grid}
.lead-calendar-item{
  display:grid;
  grid-template-columns:72px minmax(240px,1fr) auto minmax(120px,auto);
  align-items:center;
  gap:12px;
  width:100%;
  border:0;
  border-bottom:1px solid var(--line);
  background:#fff;
  padding:13px 15px;
  text-align:left
}
.lead-calendar-item:last-child{border-bottom:0}
.lead-calendar-item:hover{background:#f8fafc}
.lead-calendar-item.overdue{border-left:4px solid var(--bad)}
.lead-calendar-item time{
  color:var(--accent);
  font-weight:900
}
.lead-calendar-item span small{
  display:block;
  margin-top:4px;
  color:var(--muted)
}
.lead-calendar-item>small{
  color:var(--muted);
  text-align:right
}
.lead-hub-summary-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(160px,1fr));
  gap:10px
}
.lead-hub-summary-grid>div{
  display:grid;
  gap:6px;
  min-height:72px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#f8fafc
}
.lead-hub-summary-grid small{color:var(--muted)}
.lead-hub-summary-grid .span-2{grid-column:span 2}
.lead-inline-activity,
.lead-inline-task{white-space:nowrap}
.mobile-nav.lead-hub-mobile-nav{grid-template-columns:repeat(6,1fr)}

@media(max-width:1200px){
  .follow-kpis{grid-template-columns:repeat(3,1fr)}
  .follow-filter-grid{grid-template-columns:repeat(3,minmax(160px,1fr))}
  .lead-hub-summary-grid{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:720px){
  .follow-kpis{grid-template-columns:repeat(2,1fr)}
  .follow-filter-grid{grid-template-columns:1fr}
  .follow-modal-head,
  .follow-section-head{flex-direction:column;align-items:flex-start}
  .follow-profile-actions{flex-direction:column}
  .follow-profile-actions button{width:100%}
  .follow-footer{flex-wrap:wrap}
  .follow-footer button{flex:1}
  .follow-time-head{flex-direction:column;gap:4px}
  .lead-hub-tabs{top:0}
  .lead-hub-summary-grid{grid-template-columns:1fr}
  .lead-hub-summary-grid .span-2{grid-column:auto}
  .lead-calendar-item{
    grid-template-columns:60px 1fr;
    align-items:start
  }
  .lead-calendar-item>.follow-priority,
  .lead-calendar-item>small{
    grid-column:2;
    text-align:left
  }
}
/* CRM_LEAD_STAGE_AGING_TIMER_V1 */
.lead-stage-age{display:inline-flex;flex-direction:column;gap:2px;margin-top:6px;padding:6px 8px;border:1px solid var(--line);border-radius:9px;background:#f8fafc;min-width:110px}.lead-stage-age small{font-size:9px!important;color:var(--muted)}.lead-stage-age b{font-size:11px}.lead-stage-age.warning{background:#fff8e8;border-color:#f4d17a;color:#8b5b00}.lead-stage-age.breached{background:#fff0f1;border-color:#f0b7bb;color:#b42318}.lead-pipeline-card .lead-stage-age{width:100%;align-items:flex-start}
