:root {
  --bg: #f6f3ee;
  --card: #ffffff;
  --ink: #1d1b19;
  --muted: #6f6a63;
  --line: #e5dfd6;
  --brand: #1f3a5f;
  --brand-ink: #ffffff;
  --accent: #c8553d;
  --ok: #2e7d4f;
  --ok-bg: #e5f3ea;
  --warn: #a15c00;
  --warn-bg: #fdf0dc;
  --bad: #b3261e;
  --bad-bg: #fbe7e5;
  --soft: #efeae2;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
h1, h2, h3 { margin: 0; line-height: 1.2; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px 48px; }
.wrap.wide { max-width: 760px; }

/* ---------- üst bant ---------- */
.top {
  background: var(--brand);
  color: var(--brand-ink);
  padding: 22px 16px 26px;
}
.top .wrap { padding-bottom: 0; }
.top h1 { font-size: 26px; display: flex; align-items: center; gap: 10px; }
.top p { margin: 6px 0 0; opacity: .85; font-size: 15px; }
.top a { color: inherit; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top-row h1 { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.top-row .btn { flex: none; }
@media (max-width: 380px) { .top h1 { font-size: 22px; } }

/* ---------- kartlar ve adımlar ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.step-title { font-size: 19px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: inline-grid; place-items: center;
  font-size: 15px; flex: none;
}
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* ---------- butonlar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px;
  padding: 14px 18px; min-height: 52px;
  background: var(--brand); color: var(--brand-ink);
  font-weight: 600; cursor: pointer;
  text-decoration: none;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn.block { width: 100%; }
.btn.big { font-size: 19px; min-height: 60px; }
.btn.ghost { background: var(--soft); color: var(--ink); }
.btn.ok { background: var(--ok); }
.btn.bad { background: var(--bad-bg); color: var(--bad); }
.btn.sm { min-height: 40px; padding: 8px 12px; font-size: 15px; border-radius: 10px; }
.link { background: none; border: 0; color: var(--brand); text-decoration: underline; cursor: pointer; padding: 4px; }

/* ---------- seçim kutuları ---------- */
.choices { display: grid; gap: 10px; }
.choice {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  background: var(--card); border: 2px solid var(--line);
  border-radius: 12px; padding: 14px 16px; cursor: pointer;
}
.choice b { font-size: 18px; }
.choice .price { font-weight: 700; font-size: 18px; white-space: nowrap; }
.choice.sel { border-color: var(--brand); background: #eef3fa; }

.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.day {
  flex: none; width: 74px; scroll-snap-align: start;
  border: 2px solid var(--line); background: var(--card);
  border-radius: 12px; padding: 10px 4px; text-align: center; cursor: pointer;
}
.day .d1 { font-size: 13px; color: var(--muted); display: block; }
.day .d2 { font-size: 22px; font-weight: 700; display: block; }
.day .d3 { font-size: 13px; display: block; }
.day.sel { border-color: var(--brand); background: var(--brand); color: #fff; }
.day.sel .d1 { color: #dbe4f0; }
.day:disabled { opacity: .45; cursor: default; }

.times { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 380px) { .times { grid-template-columns: repeat(3, 1fr); } }
.time {
  border: 2px solid var(--line); background: var(--card);
  border-radius: 10px; padding: 12px 0; font-weight: 600; font-size: 17px; cursor: pointer;
}
.time.sel { background: var(--brand); color: #fff; border-color: var(--brand); }
.time:disabled { background: var(--soft); color: #b0a99f; text-decoration: line-through; border-color: transparent; cursor: default; }

/* ---------- formlar ---------- */
label.field { display: block; margin-bottom: 14px; }
label.field span { display: block; font-weight: 600; margin-bottom: 6px; }
.input {
  width: 100%; padding: 14px; min-height: 52px;
  border: 2px solid var(--line); border-radius: 12px; background: #fff;
  font-size: 18px;
}
.input:focus { outline: none; border-color: var(--brand); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }

.msg { padding: 12px 14px; border-radius: 12px; margin-top: 12px; font-weight: 500; }
.msg.err { background: var(--bad-bg); color: var(--bad); }
.msg.info { background: var(--warn-bg); color: var(--warn); }
.msg.good { background: var(--ok-bg); color: var(--ok); }

/* ---------- onay ---------- */
.success { text-align: center; padding: 28px 18px; }
.success .tick {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--ok); color: #fff; font-size: 40px;
  display: grid; place-items: center; margin: 0 auto 14px;
}
.summary { background: var(--soft); border-radius: 12px; padding: 14px; margin: 16px 0; text-align: left; }
.summary div { display: flex; justify-content: space-between; padding: 4px 0; gap: 12px; }
.summary div span:first-child { color: var(--muted); }

.appt {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 10px;
}
.appt b { display: block; font-size: 18px; }

/* ---------- modal ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(20,18,15,.5);
  display: grid; place-items: end center; z-index: 50; padding: 0;
}
.modal {
  background: var(--card); width: 100%; max-width: 520px;
  border-radius: 20px 20px 0 0; padding: 22px 18px 26px;
  max-height: 92vh; max-height: 92dvh; overflow-y: auto;
}
@media (min-width: 600px) {
  .modal-bg { place-items: center; padding: 16px; }
  .modal { border-radius: 20px; }
}
.modal h3 { font-size: 21px; margin-bottom: 16px; }
.modal .actions { display: flex; gap: 10px; margin-top: 8px; }
.modal .actions .btn { flex: 1; }

/* ---------- panel ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs button {
  flex: 1; border: 0; background: none; padding: 10px 0 12px; cursor: pointer;
  font-size: 14px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tabs button .ic { font-size: 22px; }
.tabs button.on { color: var(--brand); font-weight: 700; }
body.panel main.wrap { padding-bottom: 100px; }

.datebar { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.datebar .label { flex: 1; text-align: center; font-weight: 700; font-size: 18px; }
.datebar .btn { min-width: 52px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.stats.two { grid-template-columns: 1fr 1fr; }
.stat { background: var(--card); border-radius: 12px; padding: 12px 6px; text-align: center; min-width: 0; }
.stat b { display: block; font-size: clamp(16px, 5vw, 22px); white-space: nowrap; }
.stat span { font-size: 13px; color: var(--muted); }
.stat.hero { grid-column: 1 / -1; background: var(--brand); color: #fff; padding: 18px; }
.stat.hero b { font-size: clamp(28px, 9vw, 34px); }
.stat.hero span { color: #dbe4f0; font-size: 15px; }

.timeline { margin-top: 14px; display: grid; gap: 8px; }
.slot {
  display: flex; gap: 12px; align-items: stretch;
  background: var(--card); border-radius: 12px; padding: 12px 14px;
  border-left: 5px solid var(--line);
}
.slot .t { font-weight: 700; width: 54px; flex: none; font-variant-numeric: tabular-nums; }
.slot .t small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.slot .body { flex: 1; min-width: 0; }
.slot .name { font-weight: 700; font-size: 18px; }
.slot .meta { color: var(--muted); font-size: 15px; }
.slot .meta a { color: var(--brand); }
.slot .btns { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.slot .btns .btn { flex: 1 1 auto; }
.slot.free { background: transparent; border: 2px dashed var(--line); border-left-width: 2px; padding: 8px 12px; align-items: center; }
.slot.free .body { color: var(--muted); }
.slot.free.past { opacity: .45; }
.slot.kapali { background: var(--soft); align-items: center; }
.slot.randevu { border-left-color: var(--brand); }
.slot.geldi { border-left-color: var(--ok); }
.slot.gelmedi { border-left-color: var(--bad); opacity: .75; }
.badge { display: inline-block; font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 99px; margin-left: 6px; vertical-align: middle; }
.badge.geldi { background: var(--ok-bg); color: var(--ok); }
.badge.gelmedi { background: var(--bad-bg); color: var(--bad); }
.badge.online { background: #eef3fa; color: var(--brand); }

.list { margin-top: 10px; }
.li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li .amt { font-weight: 700; white-space: nowrap; }
.x { border: 0; background: none; color: var(--muted); font-size: 20px; cursor: pointer; padding: 4px 8px; }

.svc-row {
  display: grid; grid-template-columns: 1fr 100px 100px 40px; gap: 8px; align-items: end;
  padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line);
}
.svc-row label span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.svc-row .input { padding: 10px; min-height: 46px; font-size: 16px; }
.svc-row .x { height: 46px; }
/* Dar ekranda hizmet adı tam satır, fiyat ve süre altında yan yana */
@media (max-width: 480px) {
  .svc-row { grid-template-columns: 1fr 1fr 40px; grid-template-areas: "name name x" "price dur ."; }
  .svc-row .svc-name { grid-area: name; }
  .svc-row .svc-price { grid-area: price; }
  .svc-row .svc-dur { grid-area: dur; }
  .svc-row .x { grid-area: x; }
}

/* Panelde çalışan seçimi: yana kayan düğmeler */
.staffbar { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 2px; -webkit-overflow-scrolling: touch; }
.staffbar button {
  flex: 0 0 auto; border: 2px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 99px; padding: 8px 16px; font-weight: 600; cursor: pointer; min-height: 44px;
}
.staffbar button small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.staffbar button.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.staffbar button.on small { color: rgba(255,255,255,.75); }
.role { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--soft); color: var(--muted); margin-left: 6px; vertical-align: middle; }

.staff-row {
  display: grid; grid-template-columns: 1fr 120px 40px; gap: 8px; align-items: end;
  padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line);
}
.staff-row label span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.staff-row .input { padding: 10px; min-height: 46px; font-size: 16px; }
.staff-row .x { height: 46px; }
.staff-row .off-days { grid-column: 1 / -1; }
.staff-row .off-days > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.weekdays.small-days { gap: 6px; }
.weekdays.small-days label { padding: 6px 9px; font-size: 14px; }
.weekdays.small-days input { width: 18px; height: 18px; }
.offday { text-align: center; }
.offday b { display: block; font-size: 18px; margin-bottom: 4px; }
.staff-income { background: var(--soft); border-radius: 12px; padding: 4px 14px; margin-bottom: 8px; }

.weekdays { display: flex; flex-wrap: wrap; gap: 8px; }
.weekdays label { display: flex; align-items: center; gap: 6px; background: var(--soft); border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.weekdays input { width: 20px; height: 20px; }


.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px;
  z-index: 60; font-weight: 600; max-width: calc(100% - 32px); text-align: center;
}
/* ---------- ana sayfa ---------- */
.hero { padding: 40px 16px 34px; }
.hero h1 { font-size: 30px; }
.hero .lead { font-size: 19px; margin: 12px 0 24px; opacity: .92; }
.hero-btns { display: grid; gap: 10px; }
.btn.light { background: #fff; color: var(--brand); }
.btn.outline { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); }
.how { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
.feat { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 18px; }

/* ---------- giriş / kayıt ---------- */
.switch { display: flex; background: var(--soft); border-radius: 12px; padding: 4px; margin-top: 16px; }
.switch button { flex: 1; border: 0; background: none; padding: 12px; border-radius: 9px; font-weight: 600; cursor: pointer; color: var(--muted); }
.switch button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.hint { font-size: 14px; margin-top: 6px; color: var(--muted); word-break: break-all; }
.hint.ok { color: var(--ok); }
.hint.bad { color: var(--bad); }
.linkbox { background: var(--soft); border-radius: 12px; padding: 14px; font-weight: 700; word-break: break-all; text-align: center; }
.btn.wa { background: #1fa855; }

.foot { text-align: center; margin-top: 28px; font-size: 14px; }
.foot a { color: var(--muted); }

/* ---------- aydınlatma metinleri ---------- */
.legal { font-size: 15px; line-height: 1.6; }
.legal h2 { font-size: 20px; margin-bottom: 4px; }
.legal h3 { font-size: 16px; margin: 18px 0 4px; }
.legal p, .legal ul { margin: 6px 0; }
.legal ul { padding-left: 20px; }
.modal .legal h2 { display: none; }
.note { font-size: 13px; color: var(--muted); margin: 10px 0 0; text-align: center; }
.note .link { font-size: inherit; padding: 0; }

.center { text-align: center; }
.mt { margin-top: 16px; }
