:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #e3e7ef;
  --border-strong: #d2d8e3;
  --text: #1d2433;
  --text-2: #5b6475;
  --text-3: #8a93a5;
  --primary: #3b5bdb;
  --primary-hover: #3049b8;
  --primary-soft: #edf1ff;
  --green: #18a058;
  --green-soft: #e7f6ee;
  --orange: #e8890c;
  --orange-soft: #fff4e5;
  --red: #d03050;
  --red-soft: #fdecef;
  --purple: #7c4dff;
  --purple-soft: #f2edff;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 60, .05), 0 4px 16px rgba(20, 30, 60, .05);
  --shadow-lg: 0 10px 40px rgba(20, 30, 60, .18);
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
h1, h2, h3 { margin: 0; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Yerleşim ---------- */
.app { display: grid; grid-template-columns: 228px 1fr; height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 18px 12px; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; }
.brand img { width: 34px; height: 34px; }
.brand b { font-size: 15px; display: block; }
.brand small { color: var(--text-3); font-size: 12px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 8px; color: var(--text-2); cursor: pointer; border: 0; background: none; width: 100%; text-align: left; font-weight: 500; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); }
.nav-item .count { margin-left: auto; background: var(--primary); color: #fff; font-size: 11px; border-radius: 10px; padding: 1px 7px; }
.sidebar .spacer { flex: 1; }
.compose-btn { margin: 0 0 14px; justify-content: center; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; cursor: pointer; }
.user-card:hover { background: var(--surface-2); }
.user-card .meta { min-width: 0; }
.user-card .meta b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .meta span { display: block; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { overflow: auto; position: relative; }
.page { padding: 26px 32px 48px; max-width: 1280px; margin: 0 auto; }
.page-header { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.page-header h1 { font-size: 22px; font-weight: 650; }
.page-header .sub { color: var(--text-2); margin-top: 3px; }
.page-header .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); cursor: pointer; background: none; border: 0; padding: 0; margin-bottom: 10px; }
.back:hover { color: var(--text); }

/* ---------- Bileşenler ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border-strong); background: var(--surface); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); border-color: #f3c0cb; }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.lg { padding: 11px 20px; font-size: 15px; }
.btn.block { width: 100%; justify-content: center; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.card-title { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.card-title h3 { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { padding: 16px 18px; }
.stat .label { color: var(--text-2); font-size: 13px; display: flex; align-items: center; gap: 7px; }
.stat .value { font-size: 26px; font-weight: 650; margin-top: 6px; letter-spacing: -.3px; }
.stat .hint { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.stat .ico { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; }
.stat .ico svg { width: 16px; height: 16px; }

.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .help { font-size: 12px; color: var(--text-3); }
.input, select.input, textarea.input { border: 1px solid var(--border-strong); border-radius: 8px; padding: 9px 11px; background: var(--surface); width: 100%; outline: none; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 91, 219, .12); }
textarea.input { resize: vertical; min-height: 80px; line-height: 1.5; }
.row { display: flex; gap: 12px; align-items: center; }
.row > .grow { flex: 1; min-width: 0; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }

.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 16px; height: 16px; }
.search .input { padding-left: 34px; width: 260px; }

.tabs { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
.tab { border: 0; background: none; padding: 6px 12px; border-radius: 7px; cursor: pointer; color: var(--text-2); font-weight: 500; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(20, 30, 60, .12); }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 20px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.blue { background: var(--primary-soft); color: var(--primary); }
.badge.orange { background: var(--orange-soft); color: var(--orange); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; }

/* Tablo */
.table-wrap { overflow: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .4px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 0; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #fafbff; }
.table .muted { color: var(--text-3); font-size: 13px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-main { font-weight: 550; max-width: 380px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-sub { color: var(--text-3); font-size: 12.5px; margin-top: 2px; max-width: 380px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ticks { display: inline-flex; font-weight: 700; letter-spacing: -4px; padding-right: 4px; color: var(--text-3); font-size: 15px; }
.ticks.seen { color: var(--green); }

.empty { text-align: center; padding: 56px 20px; color: var(--text-2); }
.empty .ico { width: 54px; height: 54px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin: 0 auto 14px; }
.empty .ico svg { width: 26px; height: 26px; }
.empty h3 { color: var(--text); font-size: 16px; margin-bottom: 6px; }
.empty p { margin: 0 0 16px; }

/* Aktivite akışı */
.feed { list-style: none; margin: 0; padding: 4px 0; }
.feed li { display: flex; gap: 12px; padding: 11px 20px; align-items: flex-start; }
.feed li + li { border-top: 1px solid var(--border); }
.feed .ev-ico { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.feed .ev-ico svg { width: 15px; height: 15px; }
.feed .ev-body { min-width: 0; flex: 1; }
.feed .ev-title { line-height: 1.4; }
.feed .ev-sub { color: var(--text-3); font-size: 12.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed .ev-time { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.ev-open { background: var(--green-soft); color: var(--green); }
.ev-click { background: var(--primary-soft); color: var(--primary); }
.ev-pdf { background: var(--red-soft); color: var(--red); }
.ev-reply { background: var(--purple-soft); color: var(--purple); }
.ev-sent { background: var(--surface-2); color: var(--text-2); }
.ev-bounce { background: var(--orange-soft); color: var(--orange); }

/* Çekmece (sağ panel) */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(20, 28, 45, .25); z-index: 40; animation: fade .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 92vw); background: var(--surface); z-index: 41; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .2s ease-out; }
.drawer-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: flex-start; }
.drawer-head h2 { font-size: 18px; font-weight: 650; word-break: break-word; }
.drawer-head .sub { color: var(--text-2); margin-top: 4px; font-size: 13px; word-break: break-word; }
.drawer-head .close { margin-left: auto; }
.drawer-body { padding: 18px 24px 30px; overflow: auto; flex: 1; }
.section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); margin: 22px 0 10px; }
.section-title:first-child { margin-top: 0; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kv > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.kv b { display: block; font-size: 19px; }
.kv span { font-size: 12px; color: var(--text-2); }

.preview-frame { width: 100%; border: 1px solid var(--border); border-radius: 8px; min-height: 220px; background: #fff; }

.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 64px 1fr 64px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .track { height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.bar-row .fill { height: 100%; background: linear-gradient(90deg, #5c7cfa, var(--primary)); border-radius: 6px; }
.bar-row .v { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20, 28, 45, .35); z-index: 50; display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: min(520px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal.wide { width: min(860px, 100%); }
.modal-head { padding: 18px 22px 0; display: flex; align-items: center; }
.modal-head h2 { font-size: 17px; font-weight: 650; }
.modal-head .close { margin-left: auto; }
.modal-body { padding: 16px 22px; overflow: auto; }
.modal-foot { padding: 14px 22px 18px; display: flex; gap: 8px; justify-content: flex-end; align-items: center; border-top: 1px solid var(--border); }
.modal-foot .left { margin-right: auto; color: var(--text-3); font-size: 13px; display: flex; align-items: center; gap: 6px; }

/* Editör */
.editor { border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); }
.editor:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 91, 219, .12); }
.editor-toolbar { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); flex-wrap: wrap; align-items: center; background: var(--surface-2); border-radius: 8px 8px 0 0; }
.editor-toolbar button { border: 0; background: none; border-radius: 6px; padding: 5px 8px; cursor: pointer; color: var(--text-2); display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.editor-toolbar button:hover { background: var(--surface); color: var(--text); }
.editor-toolbar .sep { width: 1px; height: 18px; background: var(--border-strong); margin: 0 4px; }
.editor-content { min-height: 220px; max-height: 46vh; overflow: auto; padding: 14px 16px; outline: none; line-height: 1.55; }
.editor-content a[href^="pdf://"] { background: var(--red-soft); color: var(--red); padding: 1px 6px; border-radius: 5px; text-decoration: none; font-weight: 600; }
.editor-content:empty::before { content: attr(data-placeholder); color: var(--text-3); }
.vars { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; font-size: 12.5px; color: var(--text-2); }
.var-chip { border: 1px dashed var(--primary); color: var(--primary); background: var(--primary-soft); border-radius: 6px; padding: 2px 8px; cursor: pointer; font-size: 12.5px; }

/* Alıcı girişi */
.chips-input { display: flex; flex-wrap: wrap; gap: 6px; border: 1px solid var(--border-strong); border-radius: 8px; padding: 6px 8px; background: var(--surface); position: relative; cursor: text; }
.chips-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 91, 219, .12); }
.chips-input input { border: 0; outline: none; flex: 1; min-width: 160px; padding: 3px 2px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--primary-soft); color: var(--primary); border-radius: 6px; padding: 3px 4px 3px 9px; font-size: 13px; }
.chip button { border: 0; background: none; cursor: pointer; color: inherit; padding: 0 4px; font-size: 15px; line-height: 1; }
.chip.invalid { background: var(--red-soft); color: var(--red); }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); z-index: 5; overflow: hidden; }
.suggest div { padding: 8px 12px; cursor: pointer; }
.suggest div small { color: var(--text-3); margin-left: 6px; }
.suggest div.active, .suggest div:hover { background: var(--primary-soft); }

/* Kampanya sihirbazı */
.steps-nav { display: flex; gap: 8px; margin-bottom: 22px; }
.steps-nav .s { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--text-3); font-weight: 550; }
.steps-nav .s .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border-strong); font-size: 12px; }
.steps-nav .s.active { border-color: var(--primary); color: var(--text); }
.steps-nav .s.active .n { background: var(--primary); color: #fff; border-color: var(--primary); }
.steps-nav .s.done { color: var(--text-2); }
.steps-nav .s.done .n { background: var(--green); color: #fff; border-color: var(--green); }
.wizard-foot { display: flex; justify-content: space-between; margin-top: 20px; }
.followup { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 14px; background: var(--surface-2); }
.followup-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.followup-head .input { width: 70px; }
.timeline-line { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 13px; margin: 0 0 14px 8px; }
.dropzone { border: 2px dashed var(--border-strong); border-radius: 12px; padding: 26px; text-align: center; color: var(--text-2); background: var(--surface-2); transition: .15s; }
.dropzone.over { border-color: var(--primary); background: var(--primary-soft); }

.progress { height: 8px; background: var(--surface-2); border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.progress > div { height: 100%; background: var(--primary); }

.list-cards { display: grid; gap: 12px; }
.camp-card { padding: 16px 20px; display: grid; grid-template-columns: 1.4fr repeat(4, 1fr) 24px; gap: 16px; align-items: center; cursor: pointer; }
.camp-card:hover { border-color: var(--border-strong); }
.camp-card .metric b { display: block; font-size: 17px; }
.camp-card .metric span { font-size: 12px; color: var(--text-3); }

/* Bildirim */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #1d2433; color: #fff; padding: 11px 16px; border-radius: 9px; box-shadow: var(--shadow-lg); max-width: 380px; animation: slide .2s; display: flex; gap: 9px; align-items: center; }
.toast.error { background: var(--red); }
.toast.success { background: #127a44; }

/* Giriş */
.login { height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 20% 10%, #e4eaff, transparent 50%), radial-gradient(circle at 80% 90%, #e7f6ee, transparent 45%), var(--bg); }
.login .card { width: 400px; padding: 34px 34px 28px; text-align: center; }
.login img { width: 64px; height: 64px; margin-bottom: 12px; }
.login h1 { font-size: 22px; margin-bottom: 6px; }
.login p { color: var(--text-2); margin: 0 0 24px; line-height: 1.5; }
.login .field { text-align: left; }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; }
.google-btn .g { width: 18px; height: 18px; background: #fff; border-radius: 50%; display: grid; place-items: center; color: var(--primary); font-weight: 800; font-size: 12px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 80px; }
.dev-banner { background: var(--orange-soft); color: var(--orange); font-size: 12px; font-weight: 600; text-align: center; padding: 6px 10px; border-radius: 8px; margin: 0 4px 12px; }
