/* ═══════════════════════════════════════════
   CRM DEMO — DASHBOARD
   ═══════════════════════════════════════════ */

/* ─── STAT CARDS ─── */
.dash-stats{display:grid;grid-template-columns:repeat(5,1fr);gap:14px;margin-bottom:24px}
.dash-stat{animation:fadeInUp .5s var(--ease) both}
.dash-stat:nth-child(1){animation-delay:0s}
.dash-stat:nth-child(2){animation-delay:.06s}
.dash-stat:nth-child(3){animation-delay:.12s}
.dash-stat:nth-child(4){animation-delay:.18s}
.dash-stat:nth-child(5){animation-delay:.24s}
.e-stat-value .unit{font-size:.85rem;font-weight:600;color:var(--muted);margin-left:2px}

/* ─── DASHBOARD GRID ─── */
.dash-grid{display:grid;grid-template-columns:1.2fr 1fr;gap:14px;margin-bottom:14px}
.dash-grid.triple{grid-template-columns:1fr 1fr 1fr}
.dash-panel{animation:fadeInUp .5s var(--ease) .3s both}
.dash-panel:nth-child(2){animation-delay:.38s}
.dash-panel:nth-child(3){animation-delay:.44s}
.dash-panel-head{
  padding:18px 20px 14px;display:flex;justify-content:space-between;align-items:center;
  border-bottom:1px solid var(--border);
}
.dash-panel-head h3{
  font-size:.88rem;font-weight:700;display:flex;align-items:center;gap:8px;
}
.dash-panel-head h3 i{color:var(--muted);font-size:.82rem}
.dash-panel-body{padding:0;max-height:520px;overflow-y:auto}

/* ─── PIPELINE FUNNEL ─── */
.pipeline-summary{padding:20px}
.pipeline-stage{margin-bottom:16px}
.pipeline-stage:last-child{margin-bottom:0}
.pipeline-stage-top{
  display:flex;justify-content:space-between;align-items:center;margin-bottom:7px;
}
.pipeline-stage-label{
  font-size:.8rem;font-weight:600;display:flex;align-items:center;gap:8px;
}
.pipeline-stage-dot{
  width:8px;height:8px;border-radius:50%;flex-shrink:0;
}
.pipeline-stage-meta{
  display:flex;align-items:center;gap:12px;
  font-size:.78rem;font-family:var(--en);
}
.pipeline-stage-count{
  color:var(--muted);font-weight:500;
}
.pipeline-stage-amount{
  font-weight:700;color:var(--text);
}
.pipeline-bar-track{
  height:8px;border-radius:4px;background:var(--surface2);overflow:hidden;
  position:relative;
}
.pipeline-bar-fill{
  height:100%;border-radius:4px;
  transition:width .8s var(--ease);
  position:relative;
}
.pipeline-bar-fill::after{
  content:'';position:absolute;inset:0;
  background:linear-gradient(90deg,transparent 60%,rgba(255,255,255,.15));
  border-radius:inherit;
}

/* ─── ACTIVITY TIMELINE ─── */
.activity-timeline{padding:12px 20px}
.timeline-item{
  display:flex;align-items:flex-start;gap:14px;
  padding:12px 0;border-bottom:1px solid rgba(255,255,255,.03);
  transition:background .15s;
  position:relative;
}
.timeline-item:last-child{border-bottom:none}
.timeline-item:hover{background:rgba(255,255,255,.015);margin:0 -20px;padding-left:20px;padding-right:20px;border-radius:var(--radius)}

.timeline-icon{
  width:36px;height:36px;border-radius:10px;
  display:flex;align-items:center;justify-content:center;
  font-size:.82rem;flex-shrink:0;
  position:relative;
}
.timeline-icon::after{
  content:'';position:absolute;inset:-2px;border-radius:12px;
  background:inherit;opacity:.2;filter:blur(6px);pointer-events:none;
}
.timeline-icon.meeting{background:rgba(59,130,246,.12);color:#60a5fa}
.timeline-icon.call{background:rgba(34,197,94,.1);color:#4ade80}
.timeline-icon.email{background:rgba(168,85,247,.1);color:#c084fc}
.timeline-icon.memo{background:rgba(100,116,139,.1);color:#94a3b8}
.timeline-icon.visit{background:rgba(245,158,11,.1);color:#fbbf24}

.timeline-body{flex:1;min-width:0}
.timeline-subject{
  font-size:.84rem;font-weight:600;color:var(--text);
  margin-bottom:3px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.timeline-info{
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
  font-size:.75rem;color:var(--muted);
}
.timeline-info .company{color:var(--accent);font-weight:500}
.timeline-info .sep{color:var(--dim)}
.timeline-result{
  font-size:.73rem;color:var(--text2);margin-top:4px;
  padding:4px 10px;background:var(--surface2);
  border-radius:6px;display:inline-block;
  max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}

.timeline-time{
  font-size:.72rem;color:var(--dim);font-family:var(--en);
  white-space:nowrap;flex-shrink:0;padding-top:2px;
}

/* ─── PERFORMER RANKING ─── */
.performer-list{padding:16px 20px}
.performer-item{
  display:flex;align-items:center;gap:14px;
  padding:14px 16px;border-radius:var(--radius);
  margin-bottom:8px;
  background:var(--surface2);
  border:1px solid var(--border);
  transition:all .25s var(--ease);
  position:relative;overflow:hidden;
}
.performer-item:last-child{margin-bottom:0}
.performer-item:hover{
  border-color:var(--border2);
  transform:translateX(4px);
}
.performer-item::before{
  content:'';position:absolute;left:0;top:0;bottom:0;width:3px;
  border-radius:0 2px 2px 0;
}
.performer-item:nth-child(1)::before{background:linear-gradient(180deg,#fbbf24,#f59e0b)}
.performer-item:nth-child(2)::before{background:linear-gradient(180deg,#94a3b8,#64748b)}
.performer-item:nth-child(3)::before{background:linear-gradient(180deg,#cd7f32,#a0522d)}
.performer-item:nth-child(n+4)::before{background:var(--border2)}

.performer-rank{
  width:28px;height:28px;border-radius:8px;
  display:flex;align-items:center;justify-content:center;
  font-size:.78rem;font-weight:800;font-family:var(--en);
  flex-shrink:0;
}
.performer-item:nth-child(1) .performer-rank{
  background:rgba(251,191,36,.12);color:#fbbf24;
}
.performer-item:nth-child(2) .performer-rank{
  background:rgba(148,163,184,.1);color:#94a3b8;
}
.performer-item:nth-child(3) .performer-rank{
  background:rgba(205,127,50,.1);color:#cd7f32;
}
.performer-item:nth-child(n+4) .performer-rank{
  background:var(--surface);color:var(--dim);
}

.performer-name{
  flex:1;font-size:.84rem;font-weight:600;
}
.performer-stats{
  display:flex;align-items:center;gap:16px;
}
.performer-stat{text-align:right}
.performer-stat-label{font-size:.68rem;color:var(--dim);margin-bottom:2px}
.performer-stat-value{font-size:.88rem;font-weight:700;font-family:var(--en)}

/* ─── UPCOMING SCHEDULE ─── */
.upcoming-list{padding:12px 20px}
.upcoming-item{
  display:flex;align-items:center;gap:12px;
  padding:10px 12px;border-radius:var(--radius);
  margin-bottom:4px;
  transition:background .15s;
}
.upcoming-item:last-child{margin-bottom:0}
.upcoming-item:hover{background:rgba(59,130,246,.03)}

.upcoming-type{
  padding:3px 10px;border-radius:20px;
  font-size:.68rem;font-weight:600;white-space:nowrap;flex-shrink:0;
}
.upcoming-type.meeting{background:rgba(59,130,246,.1);color:#60a5fa}
.upcoming-type.call{background:rgba(34,197,94,.1);color:#4ade80}
.upcoming-type.email{background:rgba(168,85,247,.1);color:#c084fc}
.upcoming-type.memo{background:rgba(100,116,139,.08);color:#94a3b8}
.upcoming-type.visit{background:rgba(245,158,11,.1);color:#fbbf24}

.upcoming-info{flex:1;min-width:0}
.upcoming-subject{
  font-size:.82rem;font-weight:500;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.upcoming-company{font-size:.73rem;color:var(--muted);margin-top:2px}
.upcoming-when{
  text-align:right;flex-shrink:0;
}
.upcoming-date{font-size:.75rem;font-family:var(--en);color:var(--text2);font-weight:600}
.upcoming-assigned{font-size:.68rem;color:var(--dim);margin-top:2px}

/* ─── EMPTY STATE ─── */
.dash-empty{
  padding:40px 20px;text-align:center;color:var(--dim);font-size:.84rem;
}
.dash-empty i{
  font-size:1.8rem;margin-bottom:10px;display:block;opacity:.4;
}

/* ─── STAGGERED ANIMATION ─── */
.stagger-in > *{
  opacity:0;animation:fadeInUp .4s var(--ease) both;
}
.stagger-in > *:nth-child(1){animation-delay:.05s}
.stagger-in > *:nth-child(2){animation-delay:.1s}
.stagger-in > *:nth-child(3){animation-delay:.15s}
.stagger-in > *:nth-child(4){animation-delay:.2s}
.stagger-in > *:nth-child(5){animation-delay:.25s}
.stagger-in > *:nth-child(6){animation-delay:.3s}
.stagger-in > *:nth-child(7){animation-delay:.35s}
.stagger-in > *:nth-child(8){animation-delay:.4s}
.stagger-in > *:nth-child(9){animation-delay:.45s}
.stagger-in > *:nth-child(10){animation-delay:.5s}

/* ─── CALENDAR ─── */
.cal-nav{display:flex;align-items:center;gap:4px}
.cal-month-label{
  font-size:.88rem;font-weight:700;min-width:100px;text-align:center;
  font-family:var(--en);
}
.dash-cal-header{
  display:grid;grid-template-columns:repeat(7,1fr);gap:1px;margin-bottom:8px;
}
.dash-cal-dow{
  text-align:center;font-size:.7rem;font-weight:700;color:var(--dim);
  padding:6px 0;text-transform:uppercase;letter-spacing:1px;
}
.dash-cal-dow:first-child{color:rgba(239,68,68,.6)}
.dash-cal-dow:last-child{color:rgba(59,130,246,.6)}
.dash-cal-grid{
  display:grid;grid-template-columns:repeat(7,1fr);gap:1px;
}
.dash-cal-cell{
  min-height:90px;padding:6px 8px;
  background:var(--surface2);border-radius:6px;
  transition:background .2s;position:relative;
}
.dash-cal-cell.empty{background:transparent}
.dash-cal-cell:hover{background:rgba(59,130,246,.03)}
.dash-cal-cell.today{background:rgba(59,130,246,.06);border:1px solid rgba(59,130,246,.15)}
.dash-cal-cell.has-acts{cursor:pointer}
.dash-cal-day{
  font-size:.78rem;font-weight:600;color:var(--muted);margin-bottom:4px;
  font-family:var(--en);
}
.dash-cal-day.today{
  color:var(--accent);font-weight:800;
}
.dash-cal-acts{display:flex;flex-direction:column;gap:2px}
.dash-cal-act{
  display:flex;align-items:center;gap:4px;
  padding:2px 6px;border-radius:4px;
  font-size:.65rem;color:var(--text2);
  overflow:hidden;white-space:nowrap;text-overflow:ellipsis;
  transition:background .15s;
}
.dash-cal-act:hover{background:rgba(255,255,255,.05)}
.dash-cal-act i{font-size:.55rem;flex-shrink:0}
.dash-cal-act.meeting{color:#60a5fa}.dash-cal-act.meeting i{color:#3b82f6}
.dash-cal-act.call{color:#4ade80}.dash-cal-act.call i{color:#22c55e}
.dash-cal-act.email{color:#c084fc}.dash-cal-act.email i{color:#a855f7}
.dash-cal-act.memo{color:#94a3b8}.dash-cal-act.memo i{color:#64748b}
.dash-cal-act.visit{color:#fbbf24}.dash-cal-act.visit i{color:#f59e0b}
.dash-cal-more{
  font-size:.6rem;color:var(--dim);padding:1px 6px;
}

/* ─── RESPONSIVE ─── */
@media(max-width:1280px){
  .dash-stats{grid-template-columns:repeat(3,1fr)}
  .dash-grid.triple{grid-template-columns:1fr 1fr}
}
@media(max-width:1024px){
  .dash-stats{grid-template-columns:repeat(2,1fr)}
  .dash-grid{grid-template-columns:1fr}
  .dash-grid.triple{grid-template-columns:1fr}
}
@media(max-width:768px){
  .dash-stats{grid-template-columns:repeat(2,1fr);gap:10px;margin-bottom:18px}
  .dash-grid{gap:12px;margin-bottom:12px}
  .dash-panel-head{padding:14px 14px 10px}
  .dash-panel-head h3{font-size:.82rem}
}
@media(max-width:420px){
  .dash-stats{grid-template-columns:1fr}
}
