* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #f0f2f5;
  color: #1c1e21;
  font-size: 15px;
}
a { color: #0b7285; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; }
code, .mono { font-family: Consolas, monospace; font-size: 0.85em; }

.topbar {
  display: flex; align-items: center; gap: 24px;
  background: #075e54; color: #fff; padding: 10px 24px;
}
.brand { font-weight: 700; white-space: nowrap; }
.brand-sub { font-weight: 400; opacity: 0.8; font-size: 0.85em; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a {
  color: #d0e8e4; text-decoration: none; padding: 6px 12px; border-radius: 6px;
}
.topbar nav a:hover { background: rgba(255,255,255,0.12); }
.topbar nav a.active { background: rgba(255,255,255,0.2); color: #fff; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.container { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }

.flash { padding: 10px 14px; border-radius: 8px; margin: 12px 0; }
.flash-ok { background: #d3f9d8; color: #2b8a3e; }
.flash-error { background: #ffe3e3; color: #c92a2a; }

.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 0.78em; font-weight: 600; background: #e9ecef; color: #495057;
  vertical-align: middle;
}
.badge-ok, .badge-done, .badge-approved { background: #d3f9d8; color: #2b8a3e; }
.badge-warn, .badge-scheduled, .badge-paused { background: #fff3bf; color: #e67700; }
.badge-err, .badge-canceled { background: #ffe3e3; color: #c92a2a; }
.badge-running { background: #d0ebff; color: #1971c2; }
.tag { background: #e7f5ff; color: #1971c2; padding: 2px 8px; border-radius: 999px; font-size: 0.8em; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 20px 0; }
.card { background: #fff; border-radius: 12px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.card-num { font-size: 2rem; font-weight: 700; color: #075e54; }
.card-den { font-size: 1rem; color: #868e96; margin-left: 4px; }
.card-label { font-weight: 600; margin-top: 4px; }
.card-sub { color: #868e96; font-size: 0.85em; }

.panel { background: #fff; border-radius: 12px; padding: 16px 18px; margin: 14px 0; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.panel.highlight { border-left: 4px solid #25d366; }
.empty { background: #fff; border-radius: 12px; padding: 40px; text-align: center; color: #868e96; margin: 14px 0; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
th { text-align: left; font-size: 0.8em; text-transform: uppercase; letter-spacing: 0.03em; color: #868e96; }
th, td { padding: 10px 14px; border-bottom: 1px solid #f1f3f5; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.tpl-body-cell { max-width: 280px; color: #495057; }

.btn {
  display: inline-block; border: 1px solid #ced4da; background: #fff; color: #1c1e21;
  padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 0.92em;
  text-decoration: none;
}
.btn:hover { background: #f1f3f5; }
.btn-primary { background: #075e54; border-color: #075e54; color: #fff; font-weight: 600; }
.btn-primary:hover { background: #0a7a6d; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-danger { color: #c92a2a; }
.btn-block { width: 100%; }
.row-actions { display: flex; gap: 6px; align-items: center; }
.row-actions form { display: inline; }
.row-actions details { position: relative; }
.row-actions summary { list-style: none; white-space: nowrap; }
.row-actions summary::-webkit-details-marker { display: none; }
.mini-form {
  position: absolute; right: 0; z-index: 5; width: 260px;
  display: grid; gap: 8px; padding: 12px; background: #fff;
  border: 1px solid #dee2e6; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,0.14);
}
.mini-form input { width: 100%; padding: 8px; border: 1px solid #ced4da; border-radius: 8px; }
.plain-table { box-shadow: none; border: 1px solid #e9ecef; }

.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-form { margin: 14px 0; }
.form-stack label { display: block; margin: 12px 0; font-weight: 600; }
.form-stack label .muted { font-weight: 400; }
.form-stack input[type="text"], .form-stack input[type="password"], .form-stack input[type="number"],
.form-stack textarea, .form-stack select, .form-stack input[type="datetime-local"] {
  display: block; width: 100%; margin-top: 4px; padding: 9px 12px;
  border: 1px solid #ced4da; border-radius: 8px; font: inherit;
}
.inline-form input, .inline-form select { padding: 8px 12px; border: 1px solid #ced4da; border-radius: 8px; font: inherit; }
.form-stack fieldset { border: 1px solid #e9ecef; border-radius: 8px; margin: 12px 0; }
.form-stack .radio { font-weight: 400; }
.radio input { margin-right: 6px; }
.btn-row { display: grid; grid-template-columns: 110px 1fr 1fr; gap: 8px; margin: 8px 0; }
.btn-row select, .btn-row input { padding: 8px 10px; border: 1px solid #ced4da; border-radius: 8px; font: inherit; }
.narrow { max-width: 640px; }
.muted { color: #868e96; }
.center { text-align: center; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 16px 0; }
.meta-row { display: flex; gap: 20px; flex-wrap: wrap; color: #495057; margin-bottom: 14px; }

.progress { height: 10px; background: #e9ecef; border-radius: 999px; overflow: hidden; margin: 10px 0 16px; }
.progress-bar { height: 100%; background: #25d366; border-radius: 999px; transition: width 0.4s; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: #f8f9fa; border-radius: 10px; padding: 10px; text-align: center; }
.stat-num { font-size: 1.4rem; font-weight: 700; color: #075e54; }
.stat-label { font-size: 0.78em; color: #868e96; }

.two-col { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* WhatsApp telefon önizlemesi */
.phone { border-radius: 24px; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,0.18); background: #efeae2; }
.phone-top { display: flex; gap: 10px; align-items: center; background: #075e54; color: #fff; padding: 10px 14px; }
.pp { width: 38px; height: 38px; border-radius: 50%; background: #fff; color: #075e54; display: flex; align-items: center; justify-content: center; font-size: 1.2em; font-weight: 700; }
.pp-name { font-weight: 600; }
.pp-sub { font-size: 0.75em; opacity: 0.8; }
.phone-chat { padding: 18px 12px 24px; min-height: 260px;
  background-image: radial-gradient(circle at 20% 30%, rgba(0,0,0,0.02) 2px, transparent 2px);
  background-size: 24px 24px; }
.bubble { background: #fff; border-radius: 10px; border-top-left-radius: 2px; padding: 6px; max-width: 92%; box-shadow: 0 1px 1px rgba(0,0,0,0.1); }
.bubble img { width: 100%; border-radius: 8px; display: block; }
.pv-body { padding: 6px 8px 2px; white-space: pre-wrap; word-break: break-word; }
.pv-time { text-align: right; font-size: 0.72em; color: #8696a0; padding: 0 8px 4px; }
#pv-buttons .pv-btn {
  background: #fff; border-radius: 10px; margin-top: 4px; padding: 10px; text-align: center;
  color: #00a5f4; font-weight: 600; max-width: 92%; box-shadow: 0 1px 1px rgba(0,0,0,0.1); font-size: 0.92em;
}

/* Giriş ekranı */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #075e54; }
.login-card { background: #fff; border-radius: 16px; padding: 36px; width: 340px; text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,0.25); }
.login-logo { font-size: 3rem; }
.login-card h1 { margin: 8px 0 2px; }
.login-card p { margin-top: 0; }
.login-card input { width: 100%; padding: 10px 14px; margin: 16px 0 12px; border: 1px solid #ced4da; border-radius: 8px; font: inherit; }

.wizard-steps {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; list-style: none;
  margin: 18px 0; padding: 0;
}
.wizard-steps li {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-radius: 10px; background: #e9ecef; color: #868e96; font-weight: 600;
}
.wizard-steps li span {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  border-radius: 50%; background: #fff; color: #495057;
}
.wizard-steps li.active { background: #d0ebff; color: #1864ab; }
.wizard-steps li.done { background: #d3f9d8; color: #2b8a3e; }
.campaign-review { grid-template-columns: minmax(280px, 360px) 1fr; }
.compact-phone { max-width: 360px; margin: 0 auto; }
.preview-image-placeholder {
  min-height: 140px; border-radius: 8px; display: grid; place-items: center;
  background: #dee2e6; color: #6c757d; font-weight: 600;
}
.pv-button {
  max-width: 92%; margin-top: 3px; padding: 9px; border-radius: 8px;
  background: #fff; color: #0b7285; text-align: center; box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}
.review-stack { display: grid; gap: 12px; }
.review-step { margin: 0; }
.review-step.complete { border-left: 4px solid #2f9e44; }
.review-step-head { display: flex; align-items: center; gap: 10px; }
.review-step-head span {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 50%; background: #075e54; color: #fff; font-weight: 700;
}
.review-step-head h2 { margin: 0; }
.disabled-step { opacity: 0.65; }
.review-summary { margin: 16px 0; }
.review-summary div {
  display: flex; justify-content: space-between; gap: 16px; padding: 9px 0;
  border-bottom: 1px solid #e9ecef;
}
.review-summary dt { color: #495057; }
.review-summary dd { margin: 0; font-weight: 700; }
.notice-success, .notice-warning, .notice-error {
  padding: 10px 12px; border-radius: 8px; margin: 12px 0;
}
.notice-success { background: #d3f9d8; color: #2b8a3e; }
.notice-warning { background: #fff3bf; color: #a05a00; }
.notice-error { background: #ffe3e3; color: #c92a2a; }
.confirm-send-form { margin-top: 18px; padding-top: 14px; border-top: 1px solid #dee2e6; }
.confirm-check { display: block; margin-bottom: 12px; font-weight: 600; }
.confirm-send-form .btn-danger { background: #c92a2a; border-color: #c92a2a; color: #fff; font-weight: 700; }
.confirm-send-form .btn-danger:hover { background: #a51111; }
.error-page { max-width: 560px; margin: 80px auto; text-align: center; padding: 40px; }
.error-code { font-size: 3rem; line-height: 1; font-weight: 800; color: #adb5bd; }
.error-page .row-actions { justify-content: center; margin-top: 20px; }


@media (max-width: 900px) {
  .campaign-review { grid-template-columns: 1fr; }
  .wizard-steps { grid-template-columns: 1fr 1fr; }
}
