:root {
  --navy: #063762;
  --navy-2: #0b4a83;
  --gold: #f0c231;
  --bg: #f3f5f8;
  --card: #ffffff;
  --text: #1b2430;
  --muted: #6b7686;
  --border: #dde3ea;
  --wa: #1fa855;
  --danger: #c0392b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(6, 55, 98, .06), 0 6px 24px rgba(6, 55, 98, .07);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Üst bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--navy);
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .2px; }
.brand-mark { color: var(--gold); font-size: 20px; }
.tabs { display: flex; gap: 4px; }
.tab {
  color: rgba(255, 255, 255, .78);
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
}
.tab.active { background: rgba(255, 255, 255, .14); color: #fff; }
.badge {
  display: inline-block;
  min-width: 20px;
  padding: 0 6px;
  margin-left: 2px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--navy);
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}

main { max-width: 980px; margin: 0 auto; padding: 16px 16px 120px; }
h1 { font-size: 20px; margin: 0; color: var(--navy); }
h2 { font-size: 16px; margin: 0 0 12px; color: var(--navy); }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}

/* ---------- Form ---------- */
.form-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field-row { display: flex !important; justify-content: space-between; align-items: baseline; }
.field.narrow { max-width: 280px; margin-bottom: 0; }

input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--navy-2);
  box-shadow: 0 0 0 3px rgba(11, 74, 131, .15);
}
#isim { font-size: 18px; font-weight: 600; }
textarea { resize: vertical; line-height: 1.55; min-height: 180px; }
.field > .under-text { display: flex; font-weight: 400; margin-bottom: 0; justify-content: space-between; align-items: flex-start; gap: 12px; margin-top: 6px; }
.hint { display: block; color: var(--muted); font-size: 13px; }
.counter { flex: none; font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.counter.over { color: var(--danger); }
.counter-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-right: 4px; border-radius: 50%;
  background: var(--danger); color: #fff; font-size: 11px; line-height: 1; vertical-align: -3px;
}
textarea.over, textarea.over:focus { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(192, 57, 43, .15); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.4); transform: none; }

.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--navy-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.link:hover { text-decoration: underline; }

/* ---------- Önizleme ---------- */
.pages { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pages figure { margin: 0; }
.page {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 297 / 210;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}
figcaption { text-align: center; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- Butonlar ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: filter .15s, transform .05s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:hover { filter: brightness(1.06); }
.btn svg { width: 20px; height: 20px; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.whatsapp { background: var(--wa); color: #fff; }
.btn.ghost { background: #fff; color: var(--navy); border-color: var(--border); }
.btn.danger { background: #fff; color: var(--danger); border-color: #f0d0cc; }
.btn.small { padding: 7px 12px; font-size: 14px; border-radius: 10px; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions.sticky {
  position: sticky;
  bottom: 0;
  padding: 12px 0;
  background: linear-gradient(to top, var(--bg) 70%, rgba(243, 245, 248, 0));
}
.actions .btn.whatsapp { flex: 1 1 220px; }
.actions .btn.primary { flex: 1 1 140px; }

/* ---------- Kayıtlar ---------- */
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.list-head input { max-width: 280px; }
.muted { color: var(--muted); }
.small-text { font-size: 13px; margin: 6px 0 14px; }
.records { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.record {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  border-left: 4px solid var(--gold);
}
.record-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.record-head strong { font-size: 18px; color: var(--navy); }
.chip {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  background: #fdf4d4;
  border: 1px solid #f3dd8c;
  padding: 2px 9px;
  border-radius: 999px;
}
.record-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.record-text {
  margin: 8px 0 12px;
  font-size: 14px;
  color: #455060;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.record-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  max-width: min(92vw, 520px);
  background: #1b2430;
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Mobil ---------- */
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; gap: 0; }
  .pages { grid-template-columns: 1fr; }
  .field.narrow { max-width: none; }
  .brand span:last-child { font-size: 15px; }
  .list-head input { max-width: none; }
  .actions.sticky { display: grid; grid-template-columns: 1.5fr 1fr auto; gap: 8px; }
  .actions .btn { padding: 12px 10px; }
  .long { display: none; }
}
