/* ── Marketing Hub Page ── */
.marketing-page {
  --mk-accent: #ea580c;
  --mk-accent-soft: #fff7ed;
  --mk-accent-border: #fed7aa;
  --mk-wa: #059669;
  --mk-wa-soft: #ecfdf5;
  --mk-wa-border: #a7f3d0;
  --mk-sms: #2563eb;
  --mk-sms-soft: #eff6ff;
  --mk-sms-border: #bfdbfe;
  min-height: 100%;
}

.marketing-page .mk-title-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  border-left-color: var(--mk-accent) !important;
}

.marketing-page .page-title-back:hover {
  background: var(--mk-accent-soft);
  color: var(--mk-accent);
}

.marketing-page .mk-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mk-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.mk-stat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  min-height: 88px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mk-stat-card[data-status] {
  cursor: pointer;
}

.mk-stat-card[data-status]:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.mk-stat-card[data-status]:focus-visible {
  outline: 2px solid var(--mk-accent);
  outline-offset: 2px;
}

.mk-stat-card.is-active-filter {
  box-shadow: 0 0 0 2px var(--mk-accent);
}

.mk-stat-card.is-active {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.mk-stat-card.is-draft {
  background: #fffbeb;
  border-color: #fde68a;
}

.mk-stat-card.is-ended {
  background: #f3f4f6;
  border-color: #e5e7eb;
}

.mk-stat-card.is-total {
  background: var(--mk-accent-soft);
  border-color: var(--mk-accent-border);
}

.mk-stat-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.mk-stat-label {
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
}

.mk-stat-value {
  font-family: var(--font-en);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text-deep);
}

.mk-stat-card.is-active .mk-stat-value { color: #16a34a; }
.mk-stat-card.is-draft .mk-stat-value { color: #d97706; }
.mk-stat-card.is-ended .mk-stat-value { color: #6b7280; }
.mk-stat-card.is-total .mk-stat-value { color: var(--mk-accent); }

.mk-stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.7);
}

.mk-stat-icon svg {
  width: 22px;
  height: 22px;
}

.mk-stat-card.is-active .mk-stat-icon { color: #16a34a; }
.mk-stat-card.is-draft .mk-stat-icon { color: #d97706; }
.mk-stat-card.is-ended .mk-stat-icon { color: #6b7280; }
.mk-stat-card.is-total .mk-stat-icon { color: var(--mk-accent); }

.mk-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.mk-action-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  cursor: pointer;
  text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.mk-action-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.mk-action-card.is-whatsapp {
  background: var(--mk-wa-soft);
  border-color: var(--mk-wa-border);
}

.mk-action-card.is-whatsapp:hover {
  border-color: var(--mk-wa);
}

.mk-action-card.is-sms {
  background: var(--mk-sms-soft);
  border-color: var(--mk-sms-border);
}

.mk-action-card.is-sms:hover {
  border-color: var(--mk-sms);
}

.mk-action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  flex-shrink: 0;
}

.mk-action-icon svg {
  width: 22px;
  height: 22px;
}

.mk-action-card.is-whatsapp .mk-action-icon { color: var(--mk-wa); }
.mk-action-card.is-sms .mk-action-icon { color: var(--mk-sms); }

.mk-action-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mk-action-text strong {
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
}

.mk-action-text small {
  font-family: var(--font-bn);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.mk-toolbar-card {
  margin-top: var(--space-lg);
}

.mk-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mk-search-box {
  flex: 1;
  min-width: 200px;
}

.mk-table-meta {
  margin-bottom: var(--space-sm);
}

.mk-table-card.is-hidden {
  display: none;
}

.mk-table-scroll {
  overflow-x: auto;
}

.marketing-page .mk-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.marketing-page .mk-table thead th {
  background: linear-gradient(180deg, #fffbeb, #fff8e1);
  color: var(--color-text-secondary);
}

.marketing-page .mk-table tbody tr:hover {
  background: var(--mk-accent-soft);
}

.mk-campaign-cell {
  min-width: 180px;
}

.mk-campaign-title {
  display: block;
  font-weight: 600;
  color: var(--color-text-primary);
}

.mk-campaign-preview {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.mk-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: var(--font-bn);
}

.mk-badge.is-sms { background: var(--mk-sms-soft); color: var(--mk-sms); }
.mk-badge.is-whatsapp { background: var(--mk-wa-soft); color: var(--mk-wa); }
.mk-badge.is-offer { background: var(--mk-accent-soft); color: var(--mk-accent); }
.mk-badge.is-active { background: #f0fdf4; color: #16a34a; }
.mk-badge.is-draft { background: #fffbeb; color: #d97706; }
.mk-badge.is-ended { background: #f3f4f6; color: #6b7280; }

.mk-actions {
  display: flex;
  gap: 6px;
}

.mk-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.mk-action-btn:hover {
  border-color: var(--mk-accent);
  color: var(--mk-accent);
}

.mk-action-btn svg {
  width: 16px;
  height: 16px;
}

.mk-mobile-list {
  display: none;
  flex-direction: column;
  gap: var(--space-sm);
}

.mk-mobile-list.is-visible {
  display: flex;
}

.mk-mobile-card {
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.mk-mobile-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: 8px;
}

.mk-mobile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mk-mobile-actions {
  display: flex;
  gap: 6px;
  margin-top: var(--space-sm);
}

.mk-empty-state {
  display: none;
  text-align: center;
  padding: var(--space-xl);
}

.mk-empty-state.is-visible {
  display: block;
}

.mk-empty-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin-bottom: var(--space-md);
}

.mk-empty-icon-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--mk-accent-soft);
  border-radius: 50%;
  opacity: 0.6;
}

.mk-empty-icon-wrap .empty-state-icon {
  position: relative;
  width: 40px;
  height: 40px;
  color: var(--mk-accent);
}

.mk-drawer-hero {
  padding: var(--space-md);
  margin: calc(-1 * var(--space-md)) calc(-1 * var(--space-md)) var(--space-md);
  background: linear-gradient(180deg, var(--mk-accent-soft), #fff);
  border-bottom: 1px solid var(--mk-accent-border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.mk-drawer-hero.is-hidden {
  display: none;
}

.mk-drawer-hero-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.mk-drawer-hero-title {
  font-family: var(--font-bn);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
  line-height: 1.3;
}

.mk-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 300;
  padding: 12px 20px;
  background: #111827;
  color: #fff;
  border-radius: var(--radius-md);
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  transition: transform 0.3s ease;
}

.mk-toast.is-visible {
  transform: translateX(-50%) translateY(0);
}

.mk-toast.is-error {
  background: #991b1b;
}

@media (max-width: 992px) {
  .mk-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .mk-table-card { display: none !important; }
  .mk-mobile-list.is-visible { display: flex; }
  .mk-search-box { min-width: 0; }
}

@media (max-width: 768px) {
  .mk-stats-grid,
  .mk-quick-actions {
    grid-template-columns: 1fr;
  }

  .mk-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .mk-search-box,
  .marketing-page .toolbar-select {
    width: 100%;
    min-width: 0;
  }

  .mk-table-card {
    display: none !important;
  }

  .mk-mobile-list.is-visible {
    display: flex;
  }
}
