/* ── Reset & Base ─────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0f1117;
  --bg-card: #1a1d27;
  --bg-input: #252830;
  --bg-hover: #2a2d38;
  --border: #2e3140;
  --text: #e4e6eb;
  --text-secondary: #8b8fa3;
  --primary: #6366f1;
  --primary-hover: #5254cc;
  --green: #22c55e;
  --orange: #f59e0b;
  --red: #ef4444;
  --blue: #3b82f6;
  --purple: #a855f7;
  --teal: #14b8a6;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
}
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
.hidden { display: none !important; }
a { color: var(--primary); text-decoration: none; }

/* ── Login ────────────────────────────── */
.login-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #0f1117 0%, #1e1b4b 100%); }
.login-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 48px 40px; width: 380px; text-align: center; box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
.login-logo { font-size: 48px; margin-bottom: 8px; }
.login-card h1 { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.login-card > p { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; }
.login-card input { width: 100%; padding: 12px 16px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-size: 15px; margin-bottom: 16px; outline: none; transition: border-color .2s; }
.login-card input:focus { border-color: var(--primary); }
.login-card button { width: 100%; padding: 12px; background: var(--primary); color: #fff; border: none; border-radius: var(--radius); font-size: 15px; font-weight: 600; cursor: pointer; transition: background .2s; }
.login-card button:hover { background: var(--primary-hover); }
.error { color: var(--red); font-size: 13px; margin-top: 8px; }

/* ── App Layout ──────────────────────── */
.app { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────── */
.sidebar { width: 240px; background: var(--bg-card); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; z-index: 10; }
.sidebar-header { padding: 24px 20px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); }
.sidebar-header .logo { font-size: 28px; }
.sidebar-header h2 { font-size: 17px; font-weight: 700; }
.nav-links { list-style: none; padding: 12px 10px; flex: 1; }
.nav-links li a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px; color: var(--text-secondary); font-size: 14px; font-weight: 500; transition: all .15s; }
.nav-links li a:hover, .nav-links li a.active { background: var(--bg-hover); color: var(--text); }
.nav-links li a.active { background: rgba(99,102,241,0.15); color: var(--primary); }
.nav-links .icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--border); }
.btn-ghost { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 13px; padding: 6px 0; }
.btn-ghost:hover { color: var(--text); }

/* ── Content ─────────────────────────── */
.content { flex: 1; margin-left: 240px; padding: 32px 40px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.page-header h1 { font-size: 26px; font-weight: 700; }
.header-actions { display: flex; gap: 10px; }

/* ── Buttons ─────────────────────────── */
.btn-primary { padding: 9px 18px; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .2s; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { padding: 9px 18px; background: var(--bg-input); color: var(--text); border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s; }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-danger { padding: 6px 12px; background: transparent; color: var(--red); border: 1px solid rgba(239,68,68,0.3); border-radius: 6px; font-size: 12px; cursor: pointer; transition: all .15s; }
.btn-danger:hover { background: rgba(239,68,68,0.1); }
.btn-send { background: var(--green); }
.btn-send:hover { background: #16a34a; }

/* ── Stats Grid ──────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; transition: transform .15s; }
.stat-card:hover { transform: translateY(-2px); }
.stat-value { font-size: 32px; font-weight: 800; margin-bottom: 4px; }
.stat-label { font-size: 13px; color: var(--text-secondary); }
.stat-card.blue .stat-value { color: var(--blue); }
.stat-card.green .stat-value { color: var(--green); }
.stat-card.orange .stat-value { color: var(--orange); }
.stat-card.red .stat-value { color: var(--red); }
.stat-card.purple .stat-value { color: var(--purple); }
.stat-card.teal .stat-value { color: var(--teal); }

/* ── Card / Table ────────────────────── */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.card h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); padding: 10px 12px; border-bottom: 1px solid var(--border); }
tbody td { padding: 10px 12px; font-size: 13px; border-bottom: 1px solid var(--border); }
tbody tr:hover { background: var(--bg-hover); }
.center { text-align: center; color: var(--text-secondary); }

/* ── Status Badge ────────────────────── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.badge-active { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-unsubscribed { background: rgba(245,158,11,0.15); color: var(--orange); }
.badge-bounced { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-complained { background: rgba(239,68,68,0.2); color: var(--red); }
.badge-completed { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-in_progress { background: rgba(59,130,246,0.15); color: var(--blue); }
.badge-pending { background: rgba(139,143,163,0.15); color: var(--text-secondary); }
.badge-failed { background: rgba(239,68,68,0.15); color: var(--red); }

/* ── Filters ─────────────────────────── */
.filters { display: flex; gap: 12px; margin-bottom: 16px; }
.filters input, .filters select {
  padding: 9px 14px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 13px; outline: none; transition: border-color .2s;
}
.filters input { flex: 1; }
.filters input:focus, .filters select:focus { border-color: var(--primary); }

/* ── Pagination ──────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; }
.pagination button { padding: 6px 14px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 13px; cursor: pointer; }
.pagination button:hover { background: var(--bg-hover); }
.pagination button:disabled { opacity: 0.4; cursor: default; }
.pagination span { font-size: 13px; color: var(--text-secondary); }

/* ── Modal ────────────────────────────── */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 100; backdrop-filter: blur(4px); }
.modal-content { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; width: 480px; max-width: 90vw; box-shadow: 0 12px 40px rgba(0,0,0,0.5); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 16px; }
.modal-close { background: none; border: none; color: var(--text-secondary); font-size: 18px; cursor: pointer; padding: 4px; }
.modal-close:hover { color: var(--text); }
.upload-template-section { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 12px 16px; background: var(--bg-card, #1e293b); border: 1px dashed var(--border, #334155); border-radius: 8px; }
.upload-template-section p { margin: 0; font-size: 13px; color: var(--text-secondary, #94a3b8); }
.modal-body { padding: 24px; }
.modal-body input[type="file"] { width: 100%; margin-bottom: 16px; }
.modal-body input, .modal-body select { width: 100%; padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 14px; margin-bottom: 12px; outline: none; }
.modal-body input:focus { border-color: var(--primary); }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }

/* ── Compose Layout ──────────────────── */
.compose-banner {
  margin-bottom: 18px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(20, 184, 166, 0.28);
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.14), rgba(59, 130, 246, 0.08)),
    rgba(15, 17, 23, 0.92);
  font-size: 13px;
  color: #d5fff7;
}
.compose-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 24px;
  align-items: start;
}
.editor-panel {
  background:
    radial-gradient(circle at top right, rgba(99,102,241,0.14), transparent 42%),
    linear-gradient(180deg, rgba(26,29,39,0.98), rgba(17,19,28,0.98));
  border: 1px solid rgba(99,102,241,0.18);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 18px 60px rgba(5, 8, 18, 0.28);
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-group input, .form-group textarea {
  width: 100%; padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 14px; outline: none; resize: vertical; font-family: 'SF Mono', 'Fira Code', monospace;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary); }
.field-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.field-tip { font-size: 12px; color: var(--text-secondary); }
.editor-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
  margin-bottom: 18px;
  border-radius: 16px;
  border: 1px solid rgba(59,130,246,0.18);
  background: rgba(12, 16, 28, 0.65);
}
.editor-toolbar-label {
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.snippet-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.snippet-btn {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(99,102,241,0.22);
  background: rgba(99,102,241,0.1);
  color: #e9e7ff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s, background .15s, border-color .15s;
}
.snippet-btn:hover {
  transform: translateY(-1px);
  background: rgba(99,102,241,0.18);
  border-color: rgba(99,102,241,0.34);
}
.asset-studio {
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(20,184,166,0.22);
  background: linear-gradient(180deg, rgba(14, 22, 28, 0.96), rgba(12, 16, 22, 0.96));
}
.asset-studio-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.asset-eyebrow {
  margin-bottom: 4px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
}
.asset-studio h3 { font-size: 18px; font-weight: 700; }
.asset-help { font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; }
.asset-help code { color: #d5fff7; }
.file-trigger { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.asset-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.asset-empty {
  padding: 18px;
  border: 1px dashed rgba(139,143,163,0.34);
  border-radius: 14px;
  color: var(--text-secondary);
  text-align: center;
  font-size: 13px;
}
.asset-card {
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(20, 24, 34, 0.92);
}
.asset-card img {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: #0c1018;
}
.asset-card-body { padding: 14px; }
.asset-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asset-meta { margin-top: 4px; font-size: 12px; color: var(--text-secondary); }
.asset-placeholder {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(8, 10, 18, 0.8);
  color: #c7f9f2;
  font-size: 11px;
  overflow: auto;
}
.asset-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.asset-actions button { flex: 1; min-width: 0; }
.compose-preview {
  position: sticky;
  top: 28px;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.1), transparent 36%),
    var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
}
.compose-preview h3 { font-size: 14px; font-weight: 600; color: var(--text-secondary); margin-bottom: 12px; }
.email-preview-frame { background: #ffffff; border-radius: 8px; padding: 0; min-height: 400px; overflow: auto; }
.email-preview-frame iframe { width: 100%; min-height: 400px; border: none; border-radius: 8px; }

/* ── Rich Text Editor ────────────────── */
.rich-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: var(--bg-input);
}
.rich-toolbar .tb-sep {
  width: 1px;
  height: 22px;
  margin: 0 6px;
  background: var(--border);
  flex-shrink: 0;
}
.rich-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.rich-toolbar button:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--border);
}
.rich-toolbar button.active {
  background: rgba(99,102,241,0.18);
  color: var(--primary);
  border-color: rgba(99,102,241,0.3);
}
.rich-toolbar .tb-source {
  margin-left: auto;
  width: auto;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  gap: 4px;
  letter-spacing: 0.02em;
}
.rich-toolbar .tb-source.active {
  background: rgba(245,158,11,0.15);
  color: var(--orange);
  border-color: rgba(245,158,11,0.3);
}
#rich-editor {
  min-height: 260px;
  max-height: 500px;
  overflow-y: auto;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  background: var(--bg-input);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, sans-serif;
  font-size: 14px;
  line-height: 1.7;
  outline: none;
  transition: border-color 0.2s;
}
#rich-editor:focus {
  border-color: var(--primary);
}
#rich-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-secondary);
  pointer-events: none;
}
/* Rich editor content styling */
#rich-editor p { margin: 0 0 8px 0; }
#rich-editor ul, #rich-editor ol { margin: 4px 0 8px 20px; padding: 0; }
#rich-editor li { margin-bottom: 2px; }
#rich-editor h1 { font-size: 24px; font-weight: 700; margin: 0 0 8px 0; }
#rich-editor h2 { font-size: 20px; font-weight: 600; margin: 0 0 8px 0; }
#rich-editor h3 { font-size: 16px; font-weight: 600; margin: 0 0 8px 0; }
#rich-editor blockquote {
  margin: 8px 0;
  padding: 8px 16px;
  border-left: 3px solid var(--primary);
  background: rgba(99,102,241,0.06);
  border-radius: 0 6px 6px 0;
}
#rich-editor a { color: var(--primary); text-decoration: underline; }
#rich-editor hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}
#rich-editor img {
  max-width: 480px;
  width: auto;
  height: auto;
  border-radius: 8px;
  margin: 8px 0;
  cursor: pointer;
  transition: outline 0.15s;
}
#rich-editor img.img-selected {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
/* Image resize popover */
.img-resize-popover {
  position: absolute;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.img-resize-popover button {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.img-resize-popover button:hover,
.img-resize-popover button.active {
  background: rgba(99,102,241,0.18);
  color: var(--primary);
  border-color: rgba(99,102,241,0.3);
}
.img-resize-popover .pop-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 2px;
}
.img-resize-popover button.pop-delete {
  color: var(--red);
  border-color: rgba(239,68,68,0.3);
}
.img-resize-popover button.pop-delete:hover {
  background: rgba(239,68,68,0.12);
}
#email-html-source {
  display: none;
  width: 100%;
  min-height: 260px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  background: var(--bg-input);
  color: #c7f9f2;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 13px;
  line-height: 1.6;
  outline: none;
  resize: vertical;
  tab-size: 2;
}
#email-html-source:focus { border-color: var(--primary); }

/* ── Toast ────────────────────────────── */
.toast { position: fixed; top: 24px; right: 24px; padding: 14px 20px; border-radius: 10px; font-size: 14px; font-weight: 500; z-index: 200; animation: slideIn .3s ease; box-shadow: var(--shadow); }
.toast-success { background: rgba(34,197,94,0.9); color: #fff; }
.toast-error { background: rgba(239,68,68,0.9); color: #fff; }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }

/* ── Responsive ──────────────────────── */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-header h2, .nav-links li a span:not(.icon), .sidebar-footer { display: none; }
  .sidebar-header { padding: 16px; justify-content: center; }
  .nav-links li a { justify-content: center; padding: 12px; }
  .content { margin-left: 60px; padding: 20px; }
  .compose-layout { grid-template-columns: 1fr; }
  .compose-preview { position: static; }
  .editor-toolbar, .field-header, .asset-studio-header, .preview-header { flex-direction: column; align-items: flex-start; }
  .preview-caption { max-width: none; text-align: left; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Warmup Banner ───────────────────── */
.warmup-banner { display: flex; align-items: center; gap: 10px; background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.3); border-radius: var(--radius); padding: 12px 18px; margin-bottom: 20px; font-size: 14px; color: var(--orange); }

/* ── Engagement Grid ─────────────────── */
.engagement-grid { display: flex; gap: 32px; flex-wrap: wrap; }
.engagement-item { display: flex; flex-direction: column; align-items: center; }
.engagement-value { font-size: 28px; font-weight: 800; }
.engagement-value.green { color: var(--green); }
.engagement-value.blue { color: var(--blue); }
.engagement-value.red { color: var(--red); }
.engagement-label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ── Bulk Actions Bar ────────────────── */
.bulk-bar { display: flex; align-items: center; gap: 12px; background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.3); border-radius: var(--radius); padding: 10px 16px; margin-bottom: 12px; font-size: 13px; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ── Preview Header ──────────────────── */
.preview-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.preview-header h3 { margin-bottom: 0; }
.preview-caption { max-width: 280px; text-align: right; font-size: 12px; color: var(--text-secondary); }

/* ── Campaign Grid ──────────────────── */
.campaign-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.campaign-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.campaign-card:hover { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(99,102,241,0.15); }
.campaign-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.campaign-card-name { font-weight: 600; font-size: 15px; }
.campaign-status { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.campaign-status.draft { background: rgba(99,102,241,0.12); color: var(--primary); }
.campaign-status.sending { background: rgba(245,158,11,0.12); color: var(--orange); }
.campaign-status.sent { background: rgba(34,197,94,0.12); color: var(--green); }
.campaign-card-subject { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.campaign-card-stats { display: flex; gap: 16px; font-size: 12px; color: var(--text-secondary); }
.campaign-card-stats span { display: flex; align-items: center; gap: 4px; }
.campaign-card-actions { display: flex; gap: 8px; margin-top: 12px; }
.campaign-name-input { background: transparent; border: none; border-bottom: 2px solid var(--border); font-size: 20px; font-weight: 700; color: var(--text); padding: 4px 0; outline: none; min-width: 260px; transition: border-color 0.2s; }
.campaign-name-input:focus { border-color: var(--primary); }
.campaign-stats-bar {
  display: flex; gap: 24px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 16px;
}
.campaign-stats-bar .cs-item { display: flex; flex-direction: column; gap: 2px; }
.campaign-stats-bar .cs-value { font-size: 20px; font-weight: 700; }
.campaign-stats-bar .cs-label { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.4px; }

/* ── Tag Pills ──────────────────────── */
.tag-pill {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 99px; font-size: 10px; font-weight: 600;
  background: rgba(99,102,241,0.12); color: var(--primary); white-space: nowrap;
}
.tag-pill-list { display: flex; flex-wrap: wrap; gap: 4px; }
.campaign-card-tag { font-size: 10px; padding: 2px 7px; border-radius: 99px; background: rgba(99,102,241,0.1); color: var(--primary); }

/* ── Campaign Editor shared styles ──── */
#campaign-rich-editor {
  min-height: 260px; max-height: 500px; overflow-y: auto;
  padding: 16px 18px; border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 8px 8px; background: var(--bg-input); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, sans-serif;
  font-size: 14px; line-height: 1.7; outline: none;
}
#campaign-rich-editor:focus { border-color: var(--primary); }
#campaign-rich-editor:empty::before { content: attr(data-placeholder); color: var(--text-secondary); pointer-events: none; }
#campaign-rich-editor p { margin: 0 0 8px 0; }
#campaign-rich-editor ul, #campaign-rich-editor ol { margin: 4px 0 8px 20px; padding: 0; }
#campaign-rich-editor h1 { font-size: 24px; font-weight: 700; margin: 0 0 8px 0; }
#campaign-rich-editor h2 { font-size: 20px; font-weight: 600; margin: 0 0 8px 0; }
#campaign-rich-editor h3 { font-size: 16px; font-weight: 600; margin: 0 0 8px 0; }
#campaign-rich-editor blockquote { margin: 8px 0; padding: 8px 16px; border-left: 3px solid var(--primary); background: rgba(99,102,241,0.06); border-radius: 0 6px 6px 0; }
#campaign-rich-editor a { color: var(--primary); text-decoration: underline; }
#campaign-rich-editor hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
#campaign-rich-editor img { max-width: 480px; width: auto; height: auto; border-radius: 8px; margin: 8px 0; cursor: pointer; }

/* ── Merge Tag Bar ──────────────────── */
.merge-tag-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 12px;
  background: rgba(99,102,241,0.06); border: 1px dashed rgba(99,102,241,0.25);
  border-radius: var(--radius);
}
.merge-tag-label { font-size: 12px; font-weight: 600; color: var(--primary); white-space: nowrap; }
.merge-tag-btn {
  padding: 4px 10px; font-size: 11px; font-weight: 600; font-family: 'SF Mono', 'Fira Code', monospace;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px;
  color: var(--primary); cursor: pointer; transition: all 0.15s;
}
.merge-tag-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

