:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --line: #e3e6ea;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --ok: #15803d;
  --warn: #b45309;
  --radius: 8px;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
h2 { font-size: 1.1rem; margin: 0 0 .8rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; }
pre { background: #f3f4f6; padding: .6rem .8rem; border-radius: 6px; font-size: .85rem; overflow-x: auto; }
small { font-size: .82rem; }
.muted { color: var(--muted); }
.ok-text { color: var(--ok); }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }

/* Kabuk */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 220px; flex-shrink: 0; background: #111827; color: #d1d5db;
  display: flex; flex-direction: column; padding: 1.2rem .8rem; position: sticky; top: 0; height: 100vh;
}
.brand { color: #fff; font-weight: 700; font-size: 1.25rem; padding: .2rem .7rem 1.2rem; }
.brand:hover { text-decoration: none; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a {
  color: #d1d5db; padding: .62rem .8rem; border-radius: 6px; font-size: 1.02rem;
}
.side nav a:hover { background: #1f2937; text-decoration: none; color: #fff; }
.side nav a.on { background: var(--primary); color: #fff; }
.logout { margin-top: auto; padding: 0 .8rem; }
.main { flex: 1; min-width: 0; padding: 1.6rem 2rem 4rem; max-width: 1280px; }

/* Bileşenler */
.head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; margin-bottom: 1.1rem; }
.card.flush { padding: 0; overflow-x: auto; }
.card.flush .pad, .pad { padding: 1rem 1.3rem 0; }
details.card summary { cursor: pointer; font-weight: 600; }
details.card[open] summary { margin-bottom: 1rem; }
.flash { padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid; }
.flash.ok { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }
.flash.err { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }
.flash ul { margin: .4rem 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
  padding: .55rem 1rem; border-radius: 6px; border: 1px solid var(--line); background: #fff;
  color: var(--text); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #f3f4f6; text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { color: var(--danger); border-color: #fecaca; }
.btn.danger:hover { background: #fef2f2; }
.btn.small { padding: .3rem .65rem; font-size: .88rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
button.link { background: none; border: 0; color: #9ca3af; cursor: pointer; font: inherit; padding: 0; }
button.link:hover { color: #fff; }

input[type=text], input[type=email], input[type=password], input[type=url], input[type=search],
input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid #cfd4da; border-radius: 6px;
  font: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus, .editor:focus { outline: 2px solid #bfdbfe; border-color: var(--primary); }
input[type=color] { width: 44px; height: 32px; border: 1px solid #cfd4da; border-radius: 6px; padding: 2px; vertical-align: middle; }
label { display: block; font-weight: 500; }
label small { font-weight: 400; color: var(--muted); }
label > input, label > select { margin-top: .3rem; }
label.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
label.check input { width: auto; margin: 0; }
label.check input[type=datetime-local] { width: auto; }
.label { display: block; font-weight: 500; margin-bottom: .3rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem 1rem; margin: 0; }
legend { font-weight: 600; padding: 0 .3rem; }
.row-label { display: flex; align-items: center; gap: .6rem; margin-top: .8rem; }

.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack.narrow, .narrow { max-width: 520px; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row > input { flex: 1; min-width: 180px; }
.row > input.short { flex: 0 1 140px; min-width: 100px; }
.row.between { justify-content: space-between; }
.filters { margin-bottom: 1rem; }
.filters select { width: auto; }
.inline { display: inline; }
.right { text-align: right; white-space: nowrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.2rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .65rem 1.3rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; background: #fafbfc; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; }
.num { text-align: right; white-space: nowrap; }
.card:not(.flush) table th, .card:not(.flush) table td { padding-left: .6rem; padding-right: .6rem; }

.pill { display: inline-block; padding: .12rem .55rem; border-radius: 99px; font-size: .78rem; font-weight: 600; background: #eef2f7; color: #374151; white-space: nowrap; }
.pill.active, .pill.done { background: #dcfce7; color: #166534; }
.pill.unsubscribed, .pill.cancelled { background: #f3f4f6; color: #4b5563; }
.pill.bounced, .pill.warn, .pill.paused { background: #fef3c7; color: #92400e; }
.pill.complained { background: #fee2e2; color: #991b1b; }
.pill.sending, .pill.scheduled { background: #dbeafe; color: #1e40af; }
.pill.draft { background: #f3f4f6; color: #374151; }

.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .8rem; }
.chips a { padding: .35rem .8rem; border-radius: 99px; background: #fff; border: 1px solid var(--line); color: var(--text); font-size: .9rem; }
.chips a.on { background: var(--text); color: #fff; border-color: var(--text); }
.chips a:hover { text-decoration: none; }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 1rem 0; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .8rem; margin-bottom: 1.1rem; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; display: flex; flex-direction: column; gap: .15rem; }
.tile span { color: var(--muted); font-size: .86rem; }
.tile strong { font-size: 1.5rem; }
.tile small { color: var(--muted); }
.tile.good { border-left: 4px solid var(--ok); }
.tile.warn { border-left: 4px solid #f59e0b; background: #fffbeb; }
.tile.bad { border-left: 4px solid var(--danger); background: #fef2f2; }
.result .tiles { margin-bottom: .6rem; }

.steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.steps li { display: flex; gap: .8rem; align-items: flex-start; }
.steps .tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #cfd4da; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 700; color: #fff; }
.steps li.done .tick { background: var(--ok); border-color: var(--ok); }
.steps li.done a { color: var(--muted); text-decoration: line-through; }

.facts { display: grid; grid-template-columns: 140px 1fr; gap: .5rem 1rem; margin: 0 0 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.wizard { list-style: none; display: flex; gap: .4rem; padding: 0; margin: 0 0 1.1rem; flex-wrap: wrap; }
.wizard li { padding: .4rem .9rem; border-radius: 99px; background: #e5e7eb; color: #4b5563; font-size: .9rem; }
.wizard li.on { background: var(--primary); color: #fff; font-weight: 600; }
.wizard li.done { background: #dcfce7; color: #166534; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.preview { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.preview iframe, iframe.short-frame { width: 100%; height: 72vh; border: 1px solid var(--line); border-radius: 6px; background: #f3f4f6; margin: 0 auto; display: block; transition: width .2s; }
iframe.short-frame { height: 520px; margin-top: .6rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: .3rem .7rem; font: inherit; font-size: .88rem; cursor: pointer; }
.seg button.on { background: var(--text); color: #fff; }

.layouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.layout-opt { border: 1px solid var(--line); border-radius: 6px; padding: .6rem; display: flex; gap: .5rem; cursor: pointer; font-weight: 400; }
.layout-opt:has(input:checked) { border-color: var(--primary); background: #eff6ff; }
.layout-opt input { margin-top: .2rem; }
.layout-opt span { display: flex; flex-direction: column; }
.layout-opt small { color: var(--muted); }
.img-current { display: flex; align-items: center; gap: 1rem; margin-bottom: .6rem; }
.img-current img { max-height: 60px; max-width: 200px; border: 1px solid var(--line); border-radius: 4px; }

.editor-bar { display: flex; flex-wrap: wrap; gap: 2px; border: 1px solid #cfd4da; border-bottom: 0; border-radius: 6px 6px 0 0; padding: 4px; background: #f9fafb; }
.editor-bar button { border: 1px solid transparent; background: none; padding: .3rem .6rem; border-radius: 4px; cursor: pointer; font: inherit; font-size: .9rem; }
.editor-bar button:hover { background: #fff; border-color: var(--line); }
.editor { min-height: 240px; border: 1px solid #cfd4da; border-radius: 0 0 6px 6px; padding: .8rem 1rem; background: #fff; font-size: 1rem; line-height: 1.6; overflow-wrap: anywhere; }
.editor p { margin: 0 0 .8rem; }

.progress { height: 12px; background: #e5e7eb; border-radius: 99px; overflow: hidden; margin-bottom: .6rem; }
.progress div { height: 100%; background: var(--primary); transition: width .4s; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.tpl { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.tpl iframe { width: 100%; height: 260px; border: 0; border-bottom: 1px solid var(--line); pointer-events: none; background: #f3f4f6; }
.tpl-info { padding: .8rem 1rem; display: flex; flex-direction: column; gap: .3rem; }
.copy { display: flex; gap: .6rem; align-items: center; background: #f3f4f6; padding: .6rem .8rem; border-radius: 6px; overflow-x: auto; }
.copy code { white-space: nowrap; }
.help { margin-top: 1.4rem; border-top: 1px solid var(--line); padding-top: .4rem; max-width: 640px; }
.inline-edit { display: flex; gap: .4rem; }
.inline-edit input { max-width: 280px; }
.sticky-save { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 1rem 0; }

/* Herkese açık sayfalar */
body.bare { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.bare-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 2rem; max-width: 460px; width: 100%; }
.bare-box h1 { margin-bottom: .8rem; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; padding: .8rem; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .brand { padding-bottom: .6rem; }
  .logout { margin-top: .6rem; }
  .main { padding: 1rem 16px 3rem; }
  .split, .grid2, .layouts { grid-template-columns: 1fr; }
  .preview { position: static; }
  .facts { grid-template-columns: 1fr; }
  .facts dt { margin-top: .4rem; }
  th, td { padding: .55rem .7rem; }
}
