/* Marketing Dashboard v2 — Email Performance Intelligence */

/* ── KPI Cards ─────────────────────────────────────── */
.mv2-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.mv2-kpi-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  transition: border-color 0.2s, transform 0.15s;
}

.mv2-kpi-card:hover {
  border-color: rgba(34,197,94,0.3);
  transform: translateY(-2px);
}

.mv2-kpi-attention {
  border-color: rgba(251,146,60,0.3);
}

.mv2-kpi-attention:hover {
  border-color: rgba(251,146,60,0.5);
}

.mv2-kpi-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.mv2-kpi-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #f1f5f9;
  line-height: 1.1;
}

.mv2-kpi-label {
  font-size: 0.85rem;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.mv2-kpi-sub {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 4px;
}

/* ── Section Panels ────────────────────────────────── */
.mv2-section {
  margin-bottom: 24px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
}

.mv2-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.mv2-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e2e8f0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mv2-section-body {
  padding: 20px;
}

/* ── Volume Chart ──────────────────────────────────── */
.mv2-chart-wrap {
  position: relative;
  height: 280px;
  width: 100%;
}

/* ── Campaign Table ────────────────────────────────── */
.mv2-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.mv2-table th {
  text-align: left;
  padding: 10px 14px;
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.mv2-table td {
  padding: 12px 14px;
  color: #cbd5e1;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.mv2-table tbody tr:hover {
  background: rgba(34,197,94,0.05);
}

.mv2-cell-name {
  font-weight: 600;
  color: #f1f5f9;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mv2-cell-notes {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #64748b;
  font-size: 0.82rem;
}

.mv2-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.mv2-badge-sent {
  background: rgba(34,197,94,0.15);
  color: #22c55e;
}

.mv2-badge-draft {
  background: rgba(148,163,184,0.15);
  color: #94a3b8;
}

.mv2-badge-other {
  background: rgba(96,165,250,0.15);
  color: #60a5fa;
}

.mv2-badge-bucket {
  background: rgba(168,85,247,0.15);
  color: #a855f7;
}

/* ── Contact Cards ─────────────────────────────────── */
.mv2-contacts-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mv2-contact-card {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  transition: border-color 0.2s;
}

.mv2-contact-card:hover {
  border-color: rgba(34,197,94,0.2);
}

.mv2-contact-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mv2-contact-score {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.mv2-score-hot {
  background: rgba(239,68,68,0.2);
  color: #ef4444;
  border: 2px solid rgba(239,68,68,0.4);
}

.mv2-score-warm {
  background: rgba(251,146,60,0.2);
  color: #fb923c;
  border: 2px solid rgba(251,146,60,0.4);
}

.mv2-score-cool {
  background: rgba(96,165,250,0.2);
  color: #60a5fa;
  border: 2px solid rgba(96,165,250,0.4);
}

.mv2-contact-info {
  flex: 1;
  min-width: 0;
}

.mv2-contact-name {
  font-weight: 600;
  color: #f1f5f9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mv2-contact-org {
  font-size: 0.82rem;
  color: #64748b;
}

.mv2-contact-meta {
  font-size: 0.78rem;
  color: #64748b;
  flex-shrink: 0;
}

.mv2-contact-stats {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  font-size: 0.82rem;
  color: #94a3b8;
}

.mv2-contact-status {
  background: rgba(168,85,247,0.1);
  color: #a855f7;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
}

.mv2-contact-attention {
  margin-top: 8px;
  font-size: 0.82rem;
  color: #fb923c;
}

.mv2-contact-nextstep {
  margin-top: 4px;
  font-size: 0.82rem;
  color: #22c55e;
  font-style: italic;
}

/* ── Conversation Cards ────────────────────────────── */
.mv2-convo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 500px;
  overflow-y: auto;
}

.mv2-convo-card {
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
}

.mv2-convo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.mv2-convo-from {
  font-weight: 600;
  color: #e2e8f0;
  font-size: 0.9rem;
}

.mv2-convo-date {
  font-size: 0.75rem;
  color: #64748b;
}

.mv2-convo-subject {
  font-size: 0.85rem;
  color: #94a3b8;
  font-weight: 500;
}

.mv2-convo-snippet {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Heatmap ───────────────────────────────────────── */
.mv2-heatmap-grid {
  display: grid;
  grid-template-columns: 40px repeat(24, 1fr);
  gap: 2px;
  font-size: 0.65rem;
}

.mv2-heatmap-label,
.mv2-heatmap-dlabel {
  color: #64748b;
  font-weight: 600;
  display: flex;
  align-items: center;
  font-size: 0.72rem;
}

.mv2-heatmap-hlabel {
  color: #475569;
  text-align: center;
  font-size: 0.6rem;
  padding: 2px 0;
}

.mv2-heatmap-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  font-size: 0.6rem;
  font-weight: 600;
  min-height: 18px;
  cursor: default;
  transition: transform 0.1s;
}

.mv2-heatmap-cell:hover {
  transform: scale(1.3);
  z-index: 1;
}

/* ── Subject Bars ──────────────────────────────────── */
.mv2-subject-row {
  position: relative;
  padding: 10px 14px;
  margin-bottom: 6px;
  border-radius: 8px;
  overflow: hidden;
}

.mv2-subject-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(34,197,94,0.1);
  border-radius: 8px;
  transition: width 0.3s;
}

.mv2-subject-text {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.mv2-subject-name {
  color: #cbd5e1;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.mv2-subject-count {
  color: #22c55e;
  font-weight: 700;
  font-size: 0.82rem;
  flex-shrink: 0;
}

/* ── Search ────────────────────────────────────────── */
.mv2-search {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.2);
  color: #f1f5f9;
  font-size: 0.9rem;
  width: 100%;
  max-width: 320px;
  outline: none;
  transition: border-color 0.2s;
}

.mv2-search:focus {
  border-color: rgba(34,197,94,0.4);
}

.mv2-search::placeholder {
  color: #475569;
}

/* ── Layout Grid ───────────────────────────────────── */
.mv2-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.mv2-grid .mv2-section.mv2-wide {
  grid-column: 1 / -1;
}

/* ── Top Bar ───────────────────────────────────────── */
.mv2-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.mv2-topbar h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: #f1f5f9;
}

.mv2-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: #64748b;
}

/* ── Error ─────────────────────────────────────────── */
.mv2-error {
  color: #ef4444;
  padding: 12px;
  font-size: 0.85rem;
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
  .mv2-kpis {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .mv2-kpi-card {
    padding: 14px;
  }

  .mv2-kpi-icon {
    font-size: 1.5rem;
  }

  .mv2-kpi-value {
    font-size: 1.4rem;
  }

  .mv2-grid {
    grid-template-columns: 1fr;
  }

  .mv2-chart-wrap {
    height: 200px;
  }

  .mv2-heatmap-grid {
    font-size: 0.5rem;
  }

  .mv2-heatmap-hlabel {
    font-size: 0;  /* hide hour labels on mobile */
  }

  .mv2-table {
    font-size: 0.8rem;
  }

  .mv2-table th,
  .mv2-table td {
    padding: 8px 10px;
  }

  .mv2-cell-notes {
    display: none;
  }
}

/* ── Pipeline Funnel ────────────────────────────── */
.pv2-funnel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

.pv2-funnel-label {
  width: 140px;
  flex-shrink: 0;
  font-size: 0.85rem;
  color: #cbd5e1;
  font-weight: 600;
}

.pv2-funnel-bar-wrap {
  flex: 1;
  min-width: 0;
}

.pv2-funnel-bar {
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  min-width: 40px;
  transition: width 0.3s;
}

.pv2-funnel-bar span {
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.pv2-funnel-ask {
  width: 100px;
  text-align: right;
  flex-shrink: 0;
  font-size: 0.82rem;
  color: #94a3b8;
  font-weight: 600;
}

.pv2-items-meta {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 768px) {
  .pv2-funnel-label { width: 100px; font-size: 0.75rem; }
  .pv2-funnel-ask { width: 70px; font-size: 0.72rem; }
}

@media (max-width: 480px) {
  .mv2-kpis {
    grid-template-columns: 1fr;
  }

  .mv2-kpi-card {
    padding: 12px;
    gap: 10px;
  }
}

/* Campaign Tracking Rate Badges */
.mv2-rate-hot { background: rgba(34,197,94,0.2); color: #22c55e; }
.mv2-rate-warm { background: rgba(250,204,21,0.2); color: #facc15; }
.mv2-rate-cool { background: rgba(148,163,184,0.2); color: #94a3b8; }
