:root {
  --bg: #0c0a08;
  --ink: #ecd9ad;
  --paper: rgba(18, 14, 10, 0.72);
  --card: #16110c;
  --line: rgba(212, 175, 55, 0.45);
  --accent: #d4af37;
  --muted: #cdbf9c;
  --ok: #86b46f;
  --warn: #e0a03a;
  --bad: #d9674f;
}
* { box-sizing: border-box; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Georgia', 'Iowan Old Style', serif;
  line-height: 1.5;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
}
a { color: var(--accent); }
h1, h2, h3 { font-weight: 400; margin: 0; }
small, .muted { color: var(--muted); }

/* Düğmeler ve alanlar */
.btn {
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-family: 'Courier New', monospace;
  font-size: 13px;
  padding: 9px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn.solid { background: var(--ink); color: var(--bg); }
.btn.solid:hover { background: var(--accent); border-color: var(--accent); }
.btn.small { padding: 5px 9px; font-size: 12px; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.danger:hover { background: var(--bad); color: var(--bg); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
label { display: block; font-family: 'Courier New', monospace; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 16px;
  padding: 10px 12px;
}
input:focus, select:focus, textarea:focus { outline: 1px solid var(--accent); }
input[type="checkbox"] { display: inline-block; width: auto; margin: 0 8px 0 0; }
.err { color: var(--bad); font-size: 14px; margin: 0 0 10px; }
.note { color: var(--muted); font-size: 14px; }
.help { font-size: 12px; color: var(--muted); margin: -6px 0 12px; }
.help ul { margin: 4px 0; padding-left: 18px; }

/* Giriş ve şifre sayfaları */
body.auth { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; border: 1px solid var(--line); background: var(--paper); padding: 28px 24px; }
.auth-card h1 { font-size: 24px; margin-bottom: 18px; color: var(--accent); }
.auth-card .btn { width: 100%; margin-top: 6px; }

/* Panel */
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.top strong { font-size: 20px; color: var(--accent); display: block; font-weight: 400; }
.top small { font-family: 'Courier New', monospace; font-size: 11px; }
.top form { margin: 0; }
.tabs { display: flex; gap: 4px; padding: 0 18px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted);
  font-family: 'Courier New', monospace; font-size: 13px; padding: 12px 14px; cursor: pointer; white-space: nowrap;
}
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
main { max-width: 860px; margin: 0 auto; padding: 18px; }
.view { display: none; }
.view.active { display: block; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.toolbar input[type="date"] { width: auto; margin: 0; padding: 8px 10px; }
.toolbar .spacer { flex: 1; }
.summary { color: var(--muted); font-family: 'Courier New', monospace; font-size: 13px; margin-bottom: 14px; }
.empty { color: var(--muted); border: 1px dashed var(--line); padding: 22px; text-align: center; }

.card { border: 1px solid var(--line); background: var(--card); padding: 14px 16px; margin-bottom: 10px; }
.card.dim { opacity: 0.6; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.time { font-family: 'Courier New', monospace; color: var(--accent); font-size: 15px; }
.who { font-size: 18px; margin: 2px 0; }
.meta { color: var(--muted); font-size: 14px; }
.badge { font-family: 'Courier New', monospace; font-size: 11px; padding: 2px 8px; border: 1px solid currentColor; white-space: nowrap; }
.s-booked { color: var(--warn); }
.s-confirmed { color: var(--accent); }
.s-arrived { color: var(--ok); }
.s-completed { color: var(--muted); }
.s-no_show, .s-cancelled { color: var(--bad); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.flag { color: var(--bad); font-size: 12px; font-family: 'Courier New', monospace; }
.price { font-family: 'Courier New', monospace; color: var(--accent); white-space: nowrap; }

/* Pencere */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7); display: none; align-items: flex-start; justify-content: center; padding: 24px 14px; overflow-y: auto; z-index: 10; }
.overlay.show { display: flex; }
.modal { width: 100%; max-width: 480px; background: var(--card); border: 1px solid var(--line); padding: 20px; }
.modal h2 { font-size: 20px; color: var(--accent); margin-bottom: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.chip { display: inline-flex; align-items: center; border: 1px solid var(--line); padding: 6px 10px; margin: 0; font-size: 14px; font-family: Georgia, serif; color: var(--ink); cursor: pointer; }
.chip input { margin-right: 6px; }
.chip.on { border-color: var(--accent); background: rgba(212, 175, 55, 0.14); }
.modal .actions { margin-top: 16px; justify-content: flex-end; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; font-family: 'Courier New', monospace; font-size: 13px; display: none; z-index: 20; max-width: 90vw; }
.toast.show { display: block; }
.toast.bad { background: var(--bad); }
.banner { border: 1px solid var(--bad); color: var(--bad); padding: 14px; margin-bottom: 14px; }
@media (max-width: 480px) { .row2 { grid-template-columns: 1fr; } }

/* Fotoğraflar */
.foto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin: 6px 0 10px; }
.foto { position: relative; aspect-ratio: 1; border: 1px solid var(--line); background: #000; }
.foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto button {
  position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; line-height: 1;
  background: rgba(0, 0, 0, 0.75); color: var(--ink); border: 1px solid var(--ink); cursor: pointer; font-size: 15px;
}
.foto button:hover { background: var(--bad); border-color: var(--bad); color: #000; }
.foto-satir { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.foto-satir .note { margin: 6px 0 0; font-size: 12px; }
.avatar {
  flex: none; width: 76px; height: 76px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  border: 1px solid var(--line); background: rgba(0, 0, 0, 0.4); color: var(--accent); font-family: 'Courier New', monospace; font-size: 26px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.mini { width: 40px; height: 40px; font-size: 16px; }
.kisi { display: flex; align-items: center; gap: 10px; }

/* İzin günleri */
.izin-satir { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--line); padding: 8px 10px; margin-bottom: 6px; font-size: 14px; }
.izin-satir .x { background: none; border: 1px solid var(--line); color: var(--muted); width: 28px; height: 28px; cursor: pointer; line-height: 1; }
.izin-satir .x:hover { border-color: var(--bad); color: var(--bad); }

/* Haftalık çalışma saati düzenleyici */
.saat-editoru { border: 1px solid var(--line); margin: 4px 0 14px; }
.saat-editoru[hidden] { display: none; }
.saat-grup { padding: 10px 10px 4px; border-bottom: 1px solid rgba(212, 175, 55, 0.18); }
.saat-grup:last-child { border-bottom: 0; }
.grup-baslik { font-family: 'Courier New', monospace; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.gun-secim { margin: 0 0 8px; }
.grup-saat, .mola { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; }
.grup-saat input[type="time"], .mola input[type="time"] { margin: 0; padding: 6px 8px; font-size: 15px; width: 112px; }
.mola-etiket { font-family: 'Courier New', monospace; font-size: 12px; color: var(--muted); width: 38px; }
.saat-grup > .btn { margin: 0 0 10px; }
.mola .x { background: none; border: 1px solid var(--line); color: var(--muted); width: 28px; height: 28px; cursor: pointer; line-height: 1; }
.mola .x:hover { border-color: var(--bad); color: var(--bad); }

/* KVKK metni önizleme */
.kvkk-onizleme { white-space: pre-wrap; font-family: Georgia, serif; font-size: 13px; line-height: 1.55; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3); padding: 12px; max-height: 320px; overflow: auto; margin: 0 0 12px; }
.kvkk-onizleme[hidden] { display: none; }
button.chip { background: transparent; cursor: pointer; }

/* Sektör temaları: berber (siyah-altın) ve kadın kuaförü (pembe). Panel üstünde müşteri sayfasındaki arka plan görseli kullanılır.
   Görsel en fazla 700px genişliğinde, sol üste yaslı gösterilir; işletme adı görselin sağ üstündeki boşluğa yazılır.
   Diğer sektörlerde (tema sınıfı yoksa) eski düz görünüm korunur. Personel ve işletme sahibi aynı temayı görür. */
body.tema-berber, body.tema-kuafor {
  --pw: min(100vw, 700px);
  --ps: calc(var(--pw) / 900);
  background-color: var(--bg);
  background-repeat: no-repeat;
  background-position: left top;
  background-size: var(--pw) auto;
}
body.tema-berber { --bg: #070707; --hdr: 410; background-image: url("../booking/bg.jpg"); }
body.tema-kuafor {
  --hdr: 392;
  --bg: #e6c5c7;
  --ink: #4a2c30;
  --paper: rgba(255, 247, 247, 0.78);
  --card: rgba(255, 248, 248, 0.88);
  --line: rgba(150, 96, 92, 0.5);
  --accent: #a05a53;
  --muted: #7a585b;
  --ok: #3f7a3a;
  --warn: #a8650f;
  --bad: #b0432e;
  background-image: url("../booking/themes/kuafor/bg.jpg");
}
body.tema-berber .top, body.tema-kuafor .top {
  width: var(--pw);
  min-height: calc(var(--ps) * var(--hdr));
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  text-align: right;
  padding: 14px 16px 0 calc(var(--ps) * 450);
  border-bottom: 0;
}
body.tema-berber .top strong, body.tema-kuafor .top strong { text-transform: uppercase; letter-spacing: 1.5px; line-height: 1.15; overflow-wrap: anywhere; }
body.tema-berber .top > div, body.tema-kuafor .top > div { max-width: 100%; }
body.tema-kuafor input, body.tema-kuafor select, body.tema-kuafor textarea { background: rgba(255, 255, 255, 0.72); }
body.tema-kuafor .avatar { background: rgba(255, 255, 255, 0.55); }
body.tema-kuafor .kvkk-onizleme { background: rgba(255, 255, 255, 0.6); }
body.tema-kuafor .saat-grup { border-bottom-color: rgba(150, 96, 92, 0.2); }
body.tema-kuafor .chip.on { background: rgba(160, 90, 83, 0.16); }
body.tema-kuafor .modal { background: #fbeeee; }
@media (max-width: 480px) { body.tema-berber .top small, body.tema-kuafor .top small { display: block; font-size: 10px; } }
