/* E-posta pazarlama: listeler, kampanyalar, ayarlar */

/* Menü grupları */
.sidebar nav .nav-group-label { margin: 20px 10px 6px; }

/* Ortak */
.back-link { display: inline-block; margin-bottom: 8px; color: #8d90a3; font-size: 12px; font-weight: 600; text-decoration: none; }
.back-link:hover { color: var(--purple); }
.heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.button.danger { color: #b0414f; }
.button.danger:hover { border-color: #f0c4ca; color: #9c2f3d; background: #fff6f7; }
.button:disabled { cursor: default; opacity: .55; }
.button.busy { cursor: progress; }
.bulk-divider { width: 1px; height: 20px; margin: 0 4px; background: #dcd8f7; }
.row-title { color: #34384d; font-weight: 600; text-decoration: none; }
.row-title:hover { color: var(--purple); text-decoration: underline; }
.row-sub { margin-top: 3px; color: #9a9dad; font-size: 11px; }
div.row-sub { max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.row-actions .edit-button { text-decoration: none; }
.warn-text { color: #c07228; }
.error-text { color: #b0414f; }
.error-col { max-width: 340px; }
.unsaved { color: #c07228; font-size: 12px; font-weight: 600; }
code { padding: 1px 5px; border-radius: 4px; color: #5345c4; background: #f2f0ff; font-size: .92em; }

.setup-warning { margin-bottom: 18px; padding: 12px 15px; border: 1px solid #f3dcc0; border-radius: 9px; color: #7d5525; background: #fff8ef; font-size: 13px; line-height: 1.5; }
.setup-warning a { color: #a35c12; font-weight: 600; }

/* Durum rozetleri */
.status-badge.m-muted { color: #7f8295; background: #f1f2f5; }
.status-badge.m-info { color: #3570b5; background: #eaf3ff; }
.status-badge.m-ok { color: #23855f; background: #e8f7ef; }
.status-badge.m-warn { color: #b8742f; background: #fff3e4; }
.status-badge.m-danger { color: #b0414f; background: #fdeef0; }

/* Kampanya listesi */
.campaign-cell { max-width: 380px; }
.progress-cell { min-width: 150px; }
.progress-cell small { color: #8d90a3; font-size: 11px; }
.mini-progress { height: 5px; overflow: hidden; margin-bottom: 5px; border-radius: 5px; background: #eeedf6; }
.mini-progress i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg,#897cf1,#6152d6); }

/* Düzenleyici */
.editor-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(360px,.95fr); gap: 17px; align-items: start; }
.editor-form { display: grid; gap: 16px; }
.form-field { display: grid; gap: 6px; min-width: 0; }
.form-field label, .form-field .label-text, .test-send>label { color: #5f6377; font-size: 12px; font-weight: 600; }
.form-field label small, .form-field summary small, .dialog label small { color: #a0a3b2; font-weight: 500; }
.form-field input, .form-field select, .form-field textarea, .test-send input, .dialog textarea {
  width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid #e4e6ee; border-radius: 7px; outline: 0;
  color: #34384d; background: #fff; font: inherit; font-size: 13px;
}
.form-field textarea, .dialog textarea { resize: vertical; line-height: 1.5; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus, .test-send input:focus, .dialog textarea:focus { border-color: #988ef0; box-shadow: 0 0 0 3px #7162df14; }
.code-input { min-height: 320px; font-family: ui-monospace, SFMono-Regular, Consolas, 'Cascadia Mono', monospace !important; font-size: 12.5px !important; line-height: 1.55 !important; tab-size: 2; }
.field-hint { margin: 0; color: #9093a5; font-size: 11.5px; line-height: 1.5; }
.field-hint a { color: var(--purple); }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.field-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.field-foot .text-button { color: var(--purple); font-size: 12px; font-weight: 600; }
.merge-fields { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; color: #9093a5; font-size: 11px; }
.merge-fields button { padding: 4px 8px; border: 1px solid #e3e0fb; border-radius: 20px; color: #5b4ccc; background: #f6f5ff; font-size: 11px; font-weight: 600; }
.merge-fields button:hover { background: #ebe8ff; }
.text-version summary { cursor: pointer; color: #5f6377; font-size: 12px; font-weight: 600; }
.text-version[open] summary { margin-bottom: 6px; }
.text-version textarea { margin-top: 6px; }
.test-send { display: grid; gap: 7px; padding-top: 14px; border-top: 1px solid var(--line); }
.test-send.inline { padding-top: 0; border-top: 0; }
.test-send>div { display: flex; gap: 8px; }
.test-send input { flex: 1; max-width: 340px; }

.preview-panel { position: sticky; top: 16px; display: flex; flex-direction: column; }
.mode-toggle { display: inline-flex; padding: 3px; border-radius: 8px; background: #f2f3f7; }
.mode-toggle button { padding: 5px 10px; border: 0; border-radius: 6px; color: #7a7e92; background: transparent; font-size: 12px; font-weight: 600; }
.mode-toggle button.active { color: var(--purple); background: #fff; box-shadow: 0 1px 3px #20243a14; }
.preview-envelope { display: grid; gap: 4px; margin-bottom: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfbfd; font-size: 12.5px; }
.preview-envelope div { display: flex; gap: 8px; min-width: 0; }
.preview-envelope span { flex: 0 0 48px; color: #9a9dad; }
.preview-envelope b { overflow: hidden; color: #34384d; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
#previewFrame, #reportPreview { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.preview-text { height: 640px; overflow: auto; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; color: #34384d; background: #fbfbfd; font: 12.5px/1.6 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }

/* Rapor */
.campaign-metrics { grid-template-columns: repeat(5,minmax(0,1fr)); }
.progress-wrap { display: flex; align-items: center; gap: 12px; margin: -4px 0 20px; color: #8d90a3; font-size: 12px; font-weight: 600; }
.progress-track { flex: 1; height: 8px; overflow: hidden; border-radius: 8px; background: #eceaf6; }
.progress-track i { display: block; width: 0; height: 100%; border-radius: 8px; background: linear-gradient(90deg,#897cf1,#6152d6); transition: width .5s ease; }
.progress-track i.active { background-image: linear-gradient(90deg,#897cf1,#6152d6,#897cf1); background-size: 200% 100%; animation: progress-flow 1.6s linear infinite; }
@keyframes progress-flow { from { background-position: 200% 0; } to { background-position: 0 0; } }
.sent-content { margin-top: 17px; }
.sent-content summary { cursor: pointer; color: #303449; font: 700 14px Manrope,sans-serif; }
.sent-content[open] summary { margin-bottom: 14px; }

/* Ayarlar */
.settings-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(280px,360px); gap: 17px; align-items: start; }
.settings-main { display: grid; gap: 17px; min-width: 0; }
.status-pill.warning { color: #b8742f; background: #fff3e4; }
.provider-note { margin-bottom: 18px; padding: 12px 14px; border-radius: 9px; color: #55596c; background: #f7f6ff; font-size: 12.5px; line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.check-row { display: flex !important; align-items: flex-start; gap: 8px; margin: 0 !important; color: #4d5165 !important; font-size: 13px !important; font-weight: 500 !important; line-height: 1.45; cursor: pointer; }
.check-row input { flex: 0 0 auto; width: 15px !important; height: 15px !important; min-height: 0 !important; margin: 2px 0 0; accent-color: var(--purple); }
.check-row small { color: #9a9dad; }
.tracking { gap: 9px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.form-actions .field-hint { margin-right: auto; }
.verify-result { margin-top: 14px; padding: 12px 14px; border-radius: 9px; font-size: 12.5px; line-height: 1.6; }
.verify-result.ok { color: #1f7a56; background: #eaf8f1; }
.verify-result.has-warnings { color: #7d5525; background: #fff8ef; }
.verify-result.error { color: #9c2f3d; background: #fdeef0; }
.verify-result ul { margin: 6px 0 0; padding-left: 18px; }
.panel-heading.padded { padding: 17px 17px 0; }
.checklist-panel { position: sticky; top: 16px; }
.checklist-panel h2 { margin-bottom: 14px; }
.checklist { display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.checklist li { position: relative; display: grid; gap: 3px; padding-left: 32px; counter-increment: step; }
.checklist li:before { position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--purple); background: #f0efff; font-size: 11px; font-weight: 700; content: counter(step); }
.checklist b { color: #34384d; font-size: 12.5px; }
.checklist span { color: #7f8396; font-size: 12px; line-height: 1.55; }

/* Diyaloglar */
.dialog-note { margin: 0 0 4px; color: #6f7387; font-size: 12.5px; line-height: 1.55; }
.dialog .check-row { margin: 16px 0 8px !important; }
.send-summary { margin-bottom: 4px; }
.send-big { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; color: #6f7387; font-size: 13px; }
.send-big b { color: var(--purple); font: 800 30px Manrope,sans-serif; letter-spacing: -.8px; }
.send-summary dl { display: grid; grid-template-columns: 84px minmax(0,1fr); gap: 7px 10px; margin: 0; padding: 12px 14px; border-radius: 9px; background: #f8f8fb; font-size: 12.5px; }
.send-summary dt { color: #9a9dad; }
.send-summary dd { overflow: hidden; margin: 0; color: #34384d; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.consent { padding: 11px 12px; border: 1px solid #e3e0fb; border-radius: 8px; background: #faf9ff; }

@media (max-width: 1250px) {
  .editor-grid, .settings-grid { grid-template-columns: 1fr; }
  .preview-panel, .checklist-panel { position: static; }
  .campaign-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .form-grid { grid-template-columns: 1fr; }
  .campaign-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .heading-actions { justify-content: flex-start; }
  .test-send>div { flex-wrap: wrap; }
  .sidebar nav .nav-group-label { display: none; }
}
