/* ===== Randevu Sistemi ===== */
:root {
  --primary: #7a4a2a;
  --on-primary: #fff;
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #6b7280;
  --line: #e5e7eb;
  --ok: #16a34a;
  --warn: #d97706;
  --err: #dc2626;
  --wa: #25d366;
  --radius: 16px;
  --tint: color-mix(in srgb, var(--primary) 10%, #fff);
  --tint-2: color-mix(in srgb, var(--primary) 22%, #fff);
  --primary-dark: color-mix(in srgb, var(--primary) 82%, #000);
  /* form alanları: site renginde hafif çerçeve */
  --field-border: color-mix(in srgb, var(--primary) 35%, #fff);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
}
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---- Üst alan ---- */
.hero {
  position: relative;
  background: var(--primary);
  color: var(--on-primary);
  padding: 28px 16px 64px;
  text-align: center;
}
.hero-inner { max-width: 560px; margin: 0 auto; }
.logo { display: flex; justify-content: center; align-items: center; min-height: 48px; }
.logo-text { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.logo-img { max-height: 72px; max-width: 220px; object-fit: contain; display: block; }
.slogan { margin: 8px 0 0; opacity: .85; font-size: 15px; }

/* ---- Kartlar ---- */
.wrap { max-width: 560px; margin: -44px auto 0; padding: 0 12px 24px; position: relative; }
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 24px rgba(0,0,0,.06);
  margin-bottom: 14px;
}
.step h2 {
  font-size: 17px; margin: 0 0 14px; display: flex; align-items: center; gap: 10px;
}
.num {
  width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--primary); color: var(--on-primary); font-size: 14px; font-weight: 700;
}

/* ---- Günler (takvim şeridi) ---- */
.days {
  display: flex; gap: 10px; overflow-x: auto; padding: 4px 4px 12px; margin: 0 -4px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: var(--tint-2) transparent;
}
.days::-webkit-scrollbar { height: 6px; }
.days::-webkit-scrollbar-thumb { background: var(--tint-2); border-radius: 6px; }
.day {
  flex: 0 0 76px; scroll-snap-align: start; min-height: 96px;
  border: 2px solid var(--line); background: #fff; border-radius: 16px;
  padding: 12px 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}
.day .d-top { font-size: 13px; font-weight: 600; color: var(--muted); }
.day .d-num { font-size: 28px; font-weight: 800; line-height: 1.1; }
.day .d-bot { font-size: 13px; color: var(--muted); }
.day:hover { border-color: var(--primary); }
.day:active { transform: scale(.97); }
.day.is-active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 35%, transparent); }
.day.is-active .d-top, .day.is-active .d-bot { color: var(--on-primary); opacity: .9; }
.day.is-closed { opacity: .45; cursor: not-allowed; background: #f3f4f6; }
.day.is-closed:hover { border-color: var(--line); }

/* ---- Saatler ---- */
.hours { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.hour {
  border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 8px 4px;
  display: flex; flex-direction: column; align-items: center; cursor: pointer;
}
.hour b { font-size: 15px; }
.hour small { font-size: 11px; color: var(--muted); }
.hour.has-free small { color: #15803d; font-weight: 600; }
.hour.is-full { background: #f3f4f6; }
.hour.is-full b { color: var(--muted); }
.hour.is-active { border-color: var(--primary); background: var(--tint); }
.hour.is-active small { color: var(--primary-dark); }

.minutes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot {
  border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 6px;
  min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; text-align: center; transition: transform .1s;
}
.slot b { font-size: 16px; }
.slot small { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.slot em { font-style: normal; font-size: 12px; color: var(--muted); }
/* Boş: açık yeşil · Seçili: koyu yeşil + ✓ · Dolu: kırmızı · Bekleyen: sarı · Geçmiş: gri */
.slot.st-free { background: #f0fdf4; border-color: #86efac; color: #14532d; }
.slot.st-free:hover { border-color: #22c55e; background: #dcfce7; }
.slot.st-free:active { transform: scale(.97); }
.slot.is-active, .slot.st-free.is-active {
  background: #15803d; border-color: #15803d; color: #fff;
  box-shadow: 0 0 0 3px #bbf7d0; position: relative;
}
.slot.is-active::after {
  content: "✓"; position: absolute; top: 4px; inset-inline-end: 7px; font-size: 13px; font-weight: 800;
}
.slot[disabled] { cursor: not-allowed; }
.slot.st-booked { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.slot.st-booked em { color: #b91c1c; }
.slot.st-pending { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.slot.st-past { background: #f3f4f6; color: #9ca3af; }
.slot.st-past b { text-decoration: line-through; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 12px; height: 12px; border-radius: 4px; display: inline-block; border: 1.5px solid var(--line); }
.lg.free { background: #f0fdf4; border-color: #86efac; }
.lg.selected { background: #15803d; border-color: #15803d; }
.lg.pending { background: #fffbeb; border-color: #fde68a; }
.lg.booked { background: #fef2f2; border-color: #fecaca; }
.loading, .empty { grid-column: 1 / -1; color: var(--muted); padding: 14px 0; text-align: center; }

/* ---- Form ---- */
.picked { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.picked span { background: var(--tint); color: var(--primary-dark); padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.form label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.form input:not([type=checkbox]):not([type=color]):not([type=file]), .form textarea, .form select {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px;
  border: 1.5px solid var(--field-border); border-radius: 12px; background: #fff; font-weight: 400;
  font-size: 16px; /* iOS zoom önleme */
}
.form input:focus, .form textarea:focus, .form select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--tint-2);
}
.form textarea { resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.hint { font-size: 13px; color: var(--muted); margin: 10px 0 0; text-align: center; }

/* ---- Butonlar ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 12px; border: 0; cursor: pointer; font-weight: 700;
  background: var(--primary); color: var(--on-primary); text-decoration: none; font-size: 15px;
}
.btn:hover { background: var(--primary-dark); }
.btn-block { width: 100%; }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: #1ebe57; }
.btn-ghost { background: transparent; color: var(--text); border: 1.5px solid var(--line); margin-top: 8px; }
.btn-ghost:hover { background: #f3f4f6; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { background: #15803d; }
.btn-danger { background: #fff; color: var(--err); border: 1.5px solid #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn.is-loading { opacity: .7; pointer-events: none; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ---- Uyarılar ---- */
.alert { padding: 10px 14px; border-radius: 12px; font-size: 14px; margin-bottom: 12px; }
.alert.err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert.ok { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert.warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ---- Modal ---- */
.modal { position: fixed; inset: 0; background: rgba(17,24,39,.5); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal-box { background: #fff; border-radius: 20px; padding: 24px 20px; max-width: 380px; width: 100%; text-align: center; }
.modal-box h3 { margin: 8px 0; }
.modal-box p { color: var(--muted); margin: 0 0 16px; }
.check { width: 56px; height: 56px; border-radius: 50%; background: #dcfce7; color: var(--ok); font-size: 28px; font-weight: 800; display: grid; place-items: center; margin: 0 auto; }

.foot { text-align: center; font-size: 12px; color: var(--muted); padding: 8px 0 28px; }

@media (min-width: 480px) {
  .minutes { grid-template-columns: repeat(4, 1fr); }
  .hours { grid-template-columns: repeat(5, 1fr); }
}

/* ===== Yönetim paneli ===== */
.admin-body { background: var(--bg); }
.topbar {
  background: var(--primary); color: var(--on-primary);
  padding: 10px 16px; position: sticky; top: 0; z-index: 10;
}
.topbar-inner { max-width: 900px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.topbar .logo { justify-content: flex-start; min-height: 36px; }
.topbar .logo-text { font-size: 20px; }
.topbar .logo-img { max-height: 36px; }
.topbar nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav a { white-space: nowrap; }
.topbar nav a {
  color: var(--on-primary); text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 7px 10px; border-radius: 10px; opacity: .9;
}
.topbar nav a:hover, .topbar nav a.on { background: rgba(255,255,255,.18); opacity: 1; }
.admin-wrap { max-width: 900px; margin: 0 auto; padding: 16px 12px 40px; }

.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 4px; }
.tabs a {
  flex: 0 0 auto; text-decoration: none; color: var(--text); background: #fff; border: 1.5px solid var(--line);
  padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; display: inline-flex; gap: 6px; align-items: center;
}
.tabs a.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.badge { background: rgba(0,0,0,.08); border-radius: 999px; padding: 0 7px; font-size: 12px; min-width: 20px; text-align: center; }
.tabs a.on .badge { background: rgba(255,255,255,.25); }
.badge.hot { background: var(--warn); color: #fff; }

.day-head { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 18px 4px 8px; }
.appt {
  background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 10px;
  display: grid; grid-template-columns: 64px 1fr; gap: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04); border-inline-start: 4px solid var(--line);
}
.appt.s-approved { border-inline-start-color: var(--ok); }
.appt.s-pending { border-inline-start-color: var(--warn); }
.appt.s-rejected, .appt.s-cancelled { border-inline-start-color: #9ca3af; opacity: .75; }
.appt .time { font-size: 20px; font-weight: 800; line-height: 1.1; }
.appt .time small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.appt .who { font-weight: 700; font-size: 16px; }
.appt .meta { font-size: 14px; color: var(--muted); margin-top: 2px; }
.appt .meta a { color: inherit; }
.appt .note { margin-top: 6px; font-size: 14px; background: #f9fafb; border-radius: 10px; padding: 8px 10px; white-space: pre-wrap; word-break: break-word; }
.appt .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.appt .actions form { margin: 0; }
.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-inline-start: 6px; vertical-align: middle; text-transform: uppercase; }
.pill.pending { background: #fef3c7; color: #92400e; }
.pill.approved { background: #dcfce7; color: #166534; }
.pill.rejected, .pill.cancelled { background: #f3f4f6; color: #4b5563; }
.pill.expired { background: #fee2e2; color: #991b1b; }
.admin-wrap a:not(.btn) { color: var(--primary-dark); }
.empty-box { background: #fff; border-radius: 14px; padding: 30px 16px; text-align: center; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.stat { background: #fff; border-radius: 14px; padding: 12px; }
.stat b { font-size: 22px; display: block; }
.stat span { font-size: 12px; color: var(--muted); }

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 20px; margin: 0 0 16px; text-align: center; }
.auth-logo { text-align: center; margin-bottom: 12px; color: var(--primary); }

.settings h2 { font-size: 16px; margin: 0 0 12px; }
.color-row { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.color-row input[type=color] { width: 56px; height: 44px; border: 1.5px solid var(--line); border-radius: 12px; padding: 3px; background: #fff; cursor: pointer; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--line); cursor: pointer; padding: 0; }
.logo-preview { background: var(--primary); color: var(--on-primary); border-radius: 12px; padding: 16px; display: flex; justify-content: center; margin: 8px 0 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); padding: 6px 10px; border-radius: 10px; font-weight: 500; margin: 0; cursor: pointer; }
.help { font-size: 12px; color: var(--muted); font-weight: 400; display: block; margin-top: 4px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* ---- KVKK / Çerez ---- */
.consent { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; font-size: 14px !important; }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--primary); }
.consent a, .foot a, .cookie-bar a, .legal a { color: var(--primary-dark); }
.foot div { margin-top: 4px; }
.cookie-bar {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40; max-width: 560px; margin: 0 auto;
  background: #1f2430; color: #fff; border-radius: 14px; padding: 12px 14px; font-size: 13px;
  display: flex; gap: 12px; align-items: center; justify-content: space-between; box-shadow: 0 8px 30px rgba(0,0,0,.2);
}
.cookie-bar a { color: #fff; }
.hero-sm { padding: 20px 16px 56px; }
.legal { font-size: 15px; }
.legal h1 { font-size: 20px; margin: 4px 0 14px; line-height: 1.3; }
.legal h2 { font-size: 16px; margin: 20px 0 8px; }
.legal p { margin: 0 0 10px; }
.legal ul { margin: 0 0 10px; padding-inline-start: 20px; }
.legal li { margin-bottom: 4px; }
.legal-back { margin-top: 20px; }
.legal-back .btn { margin: 0; }
.legal-edit textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px !important; line-height: 1.5; }

/* ---- Dil ---- */
.lang-switch {
  position: absolute; top: 10px; inset-inline-end: 10px; z-index: 5;
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,.16); color: var(--on-primary);
  border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 13px;
}
[dir=rtl] .lang-switch { padding: 2px 10px 2px 4px; }
.lang-switch select {
  appearance: none; -webkit-appearance: none; background: transparent; border: 0; color: inherit;
  font-weight: 600; font-size: 13px; padding: 6px 8px; cursor: pointer;
}
.lang-switch select option { color: #111827; }
.auth-card .lang-switch { position: static; background: #f3f4f6; color: var(--text); }
.ltabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0 8px; }
.ltabs button {
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.ltabs button.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.lpanel { margin-bottom: 12px; }
.lpanel > input { display: block; width: 100%; padding: 12px 14px; border: 1.5px solid var(--field-border); border-radius: 12px; font-size: 16px; }
.field-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.help.indent { margin: 0 0 14px; padding-inline-start: 30px; }
.reset-btn { margin: -4px 0 14px !important; }
.pill.lang { background: #e0e7ff; color: #3730a3; }
.hero { padding-top: 44px; }
.hero-sm { padding-top: 44px; }

/* Admin: sekme renkleri genel link renginin altında kalmasın */
.admin-wrap .tabs a { color: var(--text); }
.admin-wrap .tabs a.on { color: var(--on-primary); }
/* Üst menü: dar ekranda logo üstte, menü altta */
.topbar-inner { flex-wrap: wrap; row-gap: 6px; }
.topbar .logo-text { white-space: nowrap; }
@media (max-width: 560px) {
  .topbar nav { width: 100%; margin-inline: -6px; }
}

/* Onay kutuları da site renginde */
.form input[type=checkbox] { accent-color: var(--primary); }
.consent input { border-color: var(--field-border); }
.num-row { display: flex; align-items: center; gap: 10px; }
.num-row input { max-width: 140px; }
.num-row span { font-weight: 500; color: var(--muted); margin-top: 6px; }
/* Alt bilgi: yazılım firması */
.brand { margin-top: 10px; font-size: 12px; }
.brand a { color: var(--muted); text-decoration: none; font-weight: 600; }
.brand a:hover { color: var(--primary-dark); text-decoration: underline; }
.admin-foot { text-align: center; padding: 10px 0 24px; }

/* ---- Onay penceresi (Bootstrap modal görünümü) ---- */
.cmodal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px; }
.cmodal-backdrop { position: absolute; inset: 0; background: rgba(17,24,39,.55); opacity: 0; transition: opacity .18s ease; }
.cmodal-dialog {
  position: relative; width: 100%; max-width: 420px; background: #fff; border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25); transform: translateY(-16px) scale(.98); opacity: 0;
  transition: transform .18s ease, opacity .18s ease; overflow: hidden;
}
.cmodal.show .cmodal-backdrop { opacity: 1; }
.cmodal.show .cmodal-dialog { transform: none; opacity: 1; }
.cmodal-header { display: flex; align-items: center; gap: 12px; padding: 18px 20px 10px; }
.cmodal-icon {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 18px; background: var(--tint); color: var(--primary-dark);
}
.cmodal.is-danger .cmodal-icon { background: #fee2e2; color: #b91c1c; }
.cmodal-title { margin: 0; font-size: 17px; font-weight: 700; flex: 1; }
.cmodal-x { border: 0; background: transparent; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.cmodal-x:hover { background: #f3f4f6; }
.cmodal-body { padding: 4px 20px 18px 68px; color: #374151; font-size: 15px; line-height: 1.5; }
[dir=rtl] .cmodal-body { padding: 4px 68px 18px 20px; }
.cmodal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; background: #f9fafb; border-top: 1px solid var(--line); }
.cmodal-footer .btn { margin: 0; min-width: 96px; }
.btn-danger-solid { background: #dc2626; color: #fff; }
.btn-danger-solid:hover { background: #b91c1c; }
body.cmodal-open { overflow: hidden; }

/* ---- Tamamlandı (yöneticinin kendi takibi) ---- */
.btn-done { background: #fff; color: #15803d; border: 1.5px solid #86efac; }
.btn-done:hover { background: #f0fdf4; }
.btn-link { background: transparent; color: var(--muted); text-decoration: underline; padding-inline: 6px; }
.btn-link:hover { background: transparent; color: var(--text); }
.pill.done { background: #15803d; color: #fff; }
.appt.is-done { background: #f6fef9; border-inline-start-color: #15803d; }
.appt.is-done .who { color: #166534; }

/* ---- Sağdan sola (Arapça) ---- */
[dir=rtl] body { font-family: system-ui, -apple-system, "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif; }
[dir=rtl] .slot small, [dir=rtl] .day-head, [dir=rtl] .pill { letter-spacing: 0; text-transform: none; }
[dir=rtl] .ltabs, [dir=rtl] .tabs, [dir=rtl] .days { direction: rtl; }

@media (max-width: 420px) {
  .row3 { grid-template-columns: 1fr 1fr; }
  .topbar nav a { padding: 7px 7px; font-size: 13px; }
}
