/* ── MFV Newsletter Dashboard ── */
:root {
  --nl-purple: var(--mfv-secondary-alt, #7B35D8);
  --nl-orange: var(--mfv-accent, #F97316);
  --nl-green:  #16a34a;
  --nl-red:    var(--mfv-error, #dc2626);
  --nl-blue:   #2563eb;
  --nl-border: #e5e7eb;
  --nl-bg:     #f9fafb;
  --nl-card:   #ffffff;
  --nl-text:   #111827;
  --nl-muted:  #6b7280;
  --nl-radius: 12px;
  --nl-shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.04);
}

.mfv-nl-dash {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--nl-text);
  max-width: 900px;
}

/* ── Header ── */
.mfv-nl-dash__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.mfv-nl-dash__title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--nl-text);
}
.mfv-nl-dash__subtitle {
  font-size: 13px;
  color: var(--nl-muted);
  margin: 0;
}

/* ── Buttons ── */
.mfv-nl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: opacity .15s, transform .1s;
  white-space: nowrap;
}
.mfv-nl-btn:hover { opacity: .88; transform: translateY(-1px); }
.mfv-nl-btn--primary         { background: var(--nl-purple); color: #fff !important; }
.mfv-nl-btn--primary:hover   { color: #fff !important; }
.mfv-nl-btn--outline  { background: #fff; color: var(--nl-purple); border: 1.5px solid var(--nl-purple); }
.mfv-nl-btn--full     { width: 100%; justify-content: center; }
.mfv-nl-btn + .mfv-nl-btn { margin-top: 8px; }

/* ── Stats bar ── */
.mfv-nl-stats-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.mfv-nl-stat {
  background: var(--nl-card);
  border: 1px solid var(--nl-border);
  border-radius: 10px;
  padding: 14px 20px;
  min-width: 100px;
  box-shadow: var(--nl-shadow);
}
.mfv-nl-stat__value { display: block; font-size: 24px; font-weight: 700; color: var(--nl-purple); }
.mfv-nl-stat__label { font-size: 11px; color: var(--nl-muted); text-transform: uppercase; letter-spacing: .04em; }

/* ── Newsletter cards ── */
.mfv-nl-cards { display: flex; flex-direction: column; gap: 12px; }

.mfv-nl-card {
  background: var(--nl-card);
  border: 1px solid var(--nl-border);
  border-radius: var(--nl-radius);
  padding: 18px 20px;
  box-shadow: var(--nl-shadow);
  transition: border-color .15s;
}
.mfv-nl-card:hover { border-color: var(--nl-purple); }
.mfv-nl-card--sent  { border-left: 3px solid var(--nl-green); }
.mfv-nl-card--sending { border-left: 3px solid var(--nl-blue); }
.mfv-nl-card--queued  { border-left: 3px solid var(--nl-orange); }
.mfv-nl-card--draft   { border-left: 3px solid var(--nl-border); }

.mfv-nl-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.mfv-nl-card__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mfv-nl-card__listing { font-size: 12px; color: var(--nl-muted); }
.mfv-nl-card__title { margin: 0 0 10px; font-size: 16px; font-weight: 700; }
.mfv-nl-card__title a { color: var(--nl-text); text-decoration: none; }
.mfv-nl-card__title a:hover { color: var(--nl-purple); }
.mfv-nl-card__hint { font-size: 13px; color: var(--nl-muted); margin: 0; }
.mfv-nl-card__actions { display: flex; gap: 6px; }

/* ── Badges ── */
.mfv-nl-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.mfv-nl-badge--draft   { background: #f3f4f6; color: var(--mfv-slate-700, #374151); }
.mfv-nl-badge--queued  { background: #FEF3C7; color: #92400E; }
.mfv-nl-badge--sending { background: #DBEAFE; color: #1E40AF; }
.mfv-nl-badge--sent    { background: #DCFCE7; color: #166534; }
.mfv-nl-badge--failed  { background: #FEE2E2; color: #991B1B; }

/* ── Mini stats on cards ── */
.mfv-nl-card__stats { display: flex; gap: 16px; flex-wrap: wrap; }
.mfv-nl-mini-stat { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--nl-muted); }

/* ── Progress bar ── */
.mfv-nl-card__progress { margin-top: 8px; }
.mfv-nl-progress-bar { height: 6px; background: #e5e7eb; border-radius: 999px; overflow: hidden; margin-bottom: 6px; }
.mfv-nl-progress-bar__fill { height: 100%; background: var(--nl-blue); border-radius: 999px; animation: mfv-nl-progress 2s ease infinite; }
@keyframes mfv-nl-progress { 0%,100%{opacity:1} 50%{opacity:.6} }

/* ── Icon buttons ── */
.mfv-nl-icon-btn {
  background: none;
  border: 1px solid var(--nl-border);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  line-height: 1.4;
  transition: border-color .12s;
}
.mfv-nl-icon-btn:hover { border-color: var(--nl-purple); }

/* ── Empty state ── */
.mfv-nl-empty {
  text-align: center;
  padding: 60px 20px;
  background: var(--nl-card);
  border: 1px dashed var(--nl-border);
  border-radius: var(--nl-radius);
}
.mfv-nl-empty__icon { font-size: 48px; margin-bottom: 12px; }
.mfv-nl-empty h3 { font-size: 18px; font-weight: 700; margin: 0 0 8px; }
.mfv-nl-empty p { color: var(--nl-muted); margin: 0 0 20px; }

/* ── Upgrade CTA ── */
.mfv-nl-upgrade-cta {
  text-align: center;
  padding: 60px 40px;
  background: linear-gradient(135deg, #f5f0ff, #fff);
  border: 1px solid #e9e0ff;
  border-radius: var(--nl-radius);
}
.mfv-nl-upgrade-cta__icon { font-size: 52px; margin-bottom: 12px; }
.mfv-nl-upgrade-cta h2 { font-size: 22px; font-weight: 700; margin: 0 0 8px; }
.mfv-nl-upgrade-cta p { color: var(--nl-muted); margin: 0 0 16px; }
.mfv-nl-upgrade-cta__features {
  list-style: none;
  padding: 0;
  margin: 0 auto 24px;
  max-width: 300px;
  text-align: left;
  font-size: 14px;
  color: var(--nl-text);
}
.mfv-nl-upgrade-cta__features li { padding: 4px 0; }

/* ── Notice ── */
.mfv-nl-notice {
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}
.mfv-nl-notice--success { background: #DCFCE7; color: #166534; }
.mfv-nl-notice--error   { background: #FEE2E2; color: #991B1B; }

/* ── Back link ── */
.mfv-nl-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--nl-purple);
  text-decoration: none;
  margin-bottom: 20px;
}
.mfv-nl-back-link:hover { text-decoration: underline; }

/* ── Editor layout ── */
.mfv-nl-editor-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 780px) { .mfv-nl-editor-layout { grid-template-columns: 1fr; } }

/* ── Quick-insert blocks bar ── */
.mfv-nl-blocks-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: var(--nl-bg);
  border: 1px solid var(--nl-border);
  border-radius: 8px;
}
.mfv-nl-blocks-bar__label { font-size: 11px; font-weight: 700; color: var(--nl-muted); text-transform: uppercase; letter-spacing: .04em; margin-right: 4px; }
.mfv-nl-block-btn {
  padding: 5px 10px;
  border: 1px solid var(--nl-border);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: border-color .12s, color .12s;
  white-space: nowrap;
}
.mfv-nl-block-btn:hover { border-color: var(--nl-purple); color: var(--nl-purple); }

/* ── Form fields ── */
.mfv-nl-field { margin-bottom: 16px; }
.mfv-nl-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--nl-text); }
.mfv-nl-input, .mfv-nl-select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--nl-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--nl-text);
  background: #fff;
  box-sizing: border-box;
  transition: border-color .15s;
}
.mfv-nl-input:focus, .mfv-nl-select:focus {
  outline: none;
  border-color: var(--nl-purple);
}

/* ── WYSIWYG editor ── */
.mfv-nl-wysiwyg {
  min-height: 320px;
  padding: 16px;
  border: 1.5px solid var(--nl-border);
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--nl-text);
  background: #fff;
  outline: none;
  transition: border-color .15s;
}
.mfv-nl-wysiwyg:focus { border-color: var(--nl-purple); }
.mfv-nl-wysiwyg:empty:before {
  content: attr(data-placeholder);
  color: var(--nl-muted);
  pointer-events: none;
}
.mfv-nl-wysiwyg h1,.mfv-nl-wysiwyg h2,.mfv-nl-wysiwyg h3 { margin-top: .5em; }
.mfv-nl-wysiwyg blockquote {
  border-left: 4px solid var(--nl-purple);
  padding-left: 16px;
  color: #555;
  font-style: italic;
  margin: 12px 0;
}

/* ── Sidebar cards ── */
.mfv-nl-editor-sidebar { display: flex; flex-direction: column; gap: 12px; }
.mfv-nl-sidebar-card {
  background: var(--nl-card);
  border: 1px solid var(--nl-border);
  border-radius: var(--nl-radius);
  padding: 16px;
  box-shadow: var(--nl-shadow);
}
.mfv-nl-sidebar-card--actions { border: 1.5px solid var(--nl-purple); }
.mfv-nl-sidebar-card__title { font-size: 13px; font-weight: 700; margin: 0 0 10px; color: var(--nl-text); }

/* ── Hint text ── */
.mfv-nl-hint { font-size: 12px; color: var(--nl-muted); margin: 0; }

/* ── Result rows ── */
.mfv-nl-result-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--nl-border);
}
.mfv-nl-result-row:last-child { border-bottom: none; }

/* ── Email preview thumb ── */
.mfv-nl-preview-card { background: var(--nl-bg); }
.mfv-nl-preview-thumb {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--nl-border);
}
.mfv-nl-preview-header {
  background: linear-gradient(135deg, #7B35D8, #9D50E8);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.mfv-nl-preview-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.4);
}
.mfv-nl-preview-avatar {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.mfv-nl-preview-ministry { font-size: 12px; font-weight: 700; color: #fff; text-align: center; }
.mfv-nl-preview-body { padding: 12px; }
.mfv-nl-preview-subject { font-size: 12px; font-weight: 700; margin-bottom: 8px; color: var(--nl-text); }
.mfv-nl-preview-line {
  height: 6px;
  background: var(--nl-border);
  border-radius: 4px;
  margin-bottom: 6px;
}
.mfv-nl-preview-line--short { width: 60%; }
.mfv-nl-preview-cta {
  background: var(--nl-orange);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px;
  text-align: center;
  margin-top: 10px;
}

/* ── Newsletter Preview Modal ───────────────────────────────────────────── */
.mfv-nl-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.mfv-nl-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(3px);
}
.mfv-nl-modal__box {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.18);
  animation: nlModalIn .22s ease;
}
@keyframes nlModalIn {
  from { opacity:0; transform:translateY(18px) scale(.97); }
  to   { opacity:1; transform:none; }
}
.mfv-nl-modal__close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 18px;
  color: #888;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  z-index: 2;
}
.mfv-nl-modal__close:hover { background: #f3f4f6; color: #111; }
.mfv-nl-modal__header {
  text-align: center;
  padding: 32px 24px 20px;
  border-bottom: 1px solid #f0f0f0;
}
.mfv-nl-modal__icon { font-size: 40px; display: block; margin-bottom: 10px; }
.mfv-nl-modal__header h3 { margin: 0 0 6px; font-size: 20px; color: #111; }
.mfv-nl-modal__sub { margin: 0; font-size: 14px; color: #666; }
.mfv-nl-modal__preview-email { margin: 20px 20px 0; border-radius: 8px; overflow: hidden; }
.mfv-nl-modal__email-body { font-size: 13px; }
.mfv-nl-modal__footer { padding: 20px; border-top: 1px solid #f0f0f0; margin-top: 20px; }

/* ── Add-On Purchase Modal ──────────────────────────────────────────────── */
.mfv-nl-addon-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  color: #aaa;
  font-size: 13px;
}
.mfv-nl-addon-divider::before,
.mfv-nl-addon-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}
.mfv-nl-btn--addon-trigger {
  width: auto;
  padding-left: 28px;
  padding-right: 28px;
}
.mfv-nl-btn--addon-trigger strong { margin-left: 4px; }
.mfv-nl-addon-features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}
.mfv-nl-addon-features li {
  padding: 7px 0;
  font-size: 14px;
  color: #444;
  border-bottom: 1px solid #f3f4f6;
}
.mfv-nl-addon-features li:last-child { border: none; }
.mfv-nl-addon-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #f5f3ff, #f0fdf4);
  border-radius: 10px;
  border: 1px solid #e9d5ff;
}
.mfv-nl-addon-price {
  font-size: 32px;
  font-weight: 800;
  color: #7B35D8;
  line-height: 1;
}
.mfv-nl-addon-price span {
  font-size: 16px;
  font-weight: 600;
  color: #9ca3af;
}
.mfv-nl-addon-price-note {
  font-size: 13px;
  color: #6b7280;
}
