/*
 * Klinika — personel ekranı stilleri.
 * Tek dosya, harici font yok, bağımlılık yok.
 *
 * ── Tasarımın tek kuralı ────────────────────────────────────────────────
 * Bu ekranda RENK = RANDEVU DURUMU. Başka hiçbir şey renk harcamaz.
 * Araç çubuğu, düğmeler, paneller, seçili sekme: hepsi kâğıt ve mürekkep.
 * Sebep pratik: sekreter telefondayken ızgaraya bakıp durumu renkten
 * okuyor. Birincil düğme de mavi olursa "planlandı" mavisi bir daha asla
 * ilk bakışta ayırt edilmiyor.
 *
 * Bunun tek istisnası yok — "şimdi" çizgisi bile renksiz, koyu mürekkep.
 */

/* ══ 1. Değişkenler ═══════════════════════════════════════════════════ */

:root {
  /* Kâğıt: nötrden bir tık sıcak. Saf gri bütün gün bakılınca ölü duruyor. */
  --paper: #f4f4f1;
  --surface: #ffffff;
  --surface-sunk: #fafaf8;
  --surface-hover: #f5f5f2;

  --ink: #191b1f;
  --ink-soft: #5f636b;
  --ink-faint: #8d9199;

  --line: #e3e3de;
  --line-soft: #eeeeea;

  /* Durum dışı tek anlamlı renk: yıkıcı işlem. */
  --danger: #b4342a;
  --danger-soft: #fdf1ef;
  --danger-edge: #eccbc6;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(22, 24, 30, .05);
  --shadow-card: 0 1px 2px rgba(22, 24, 30, .05), 0 1px 3px rgba(22, 24, 30, .04);
  --shadow-pop: 0 16px 40px -12px rgba(22, 24, 30, .22), 0 2px 8px rgba(22, 24, 30, .06);

  --ring: 0 0 0 2px var(--surface), 0 0 0 4px rgba(25, 27, 31, .45);

  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text",
             "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;

  --gutter-w: 60px;
  --toolbar-h: 56px;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font: 400 13.5px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.011em; }

::selection { background: rgba(25, 27, 31, .12); }

/* Saat, tutar, yüzde: rakamlar sütun sütun hizalı kalsın. */
input[type="date"], .hour-label, .appt-time, .week-time,
.util-val, .slot-time, .now-cap { font-variant-numeric: tabular-nums; }

/* ── Ortak yardımcılar ── */

.muted { color: var(--ink-soft); }
.small { font-size: 12px; }
.error-text { color: var(--danger); margin: 0; }

.hint {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-soft);
  background: var(--surface-sunk);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
}

/* Bölüm başlıkları: küçük, harfler aralıklı, sessiz. */
.panel-title,
.sub-title,
.util-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .085em;
  color: var(--ink-faint);
}
.sub-title { margin: 20px 0 8px; }

/* ══ 2. Sahte veri şeridi ═════════════════════════════════════════════
 *
 * body flex column'un ilk çocuğu olarak duruyor; kapatılamaz ve kaydırmayla
 * kaybolmaz. Uydurma veriyi gerçekten ayırt etmenin başka bir yolu yok.
 * İnce ama sönük değil: tek kırmızı, ekranın tam genişliği.
 */

.mock-banner {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--danger);
  color: #fff;
  padding: 7px 20px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .005em;
}
.mock-banner::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  opacity: .9;
}

/* ══ 3. Kontroller ════════════════════════════════════════════════════ */

.btn {
  font: 500 13px/1 var(--font-ui);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.btn:hover:not(:disabled) { background: var(--surface-hover); border-color: #d4d4ce; }
.btn:active:not(:disabled) { background: #efefeb; box-shadow: none; }
.btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }

.btn.icon {
  padding: 0;
  width: 30px;
  height: 30px;
  font-size: 16px;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn.block { width: 100%; justify-content: center; }

/* Tek dolu düğme: mürekkep. Ekranda ondan bir tane var, o yüzden aranmıyor. */
.btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: 0 1px 2px rgba(22, 24, 30, .18);
}
.btn.primary:hover:not(:disabled) { background: #2a2d33; border-color: #2a2d33; }
.btn.primary:active:not(:disabled) { background: #101216; }

/* İkincil eylemler ana hatlı kalır; rengi yalnız yıkıcı olan taşır. */
.btn.ok, .btn.warn { color: var(--ink); }
.btn.danger { color: var(--danger); border-color: var(--danger-edge); background: var(--danger-soft); }
.btn.danger:hover:not(:disabled) { background: #fbe7e3; border-color: #e2b3ac; }

.date-input, .text-input {
  font: 400 13px/1.4 var(--font-ui);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  box-shadow: var(--shadow-sm);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.text-input { width: 100%; }
.text-input::placeholder { color: var(--ink-faint); }
.date-input:hover, .text-input:hover { border-color: #d4d4ce; }

/* Açılır listeler de .text-input taşıyor; tarayıcı okunu kendi okumuzla
   değiştiriyoruz ki iki kontrol aynı yükseklikte ve aynı dilde dursun. */
select.text-input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
    linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: right 14px center, right 9px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

:is(.date-input, .text-input):focus,
:is(.btn, .seg, .slot, .appt, .week-item, .week-head, .link-btn):focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.date-input:focus, .text-input:focus { border-color: var(--ink-faint); }

/* Segmentli anahtar: gri ray, beyaz kayan pul. */
.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: #e9e9e4;
  border-radius: 8px;
}
.seg {
  font: 500 12.5px/1 var(--font-ui);
  border: 0;
  background: none;
  padding: 6px 13px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink-soft);
  transition: background .12s ease, color .12s ease;
}
.seg:hover:not(.is-active) { color: var(--ink); }
.seg.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(22, 24, 30, .12);
}

.link-btn {
  font: 600 13px/1.4 var(--font-ui);
  text-align: left;
  border: 0;
  background: none;
  color: var(--ink);
  padding: 0;
  cursor: pointer;
  border-radius: 1px;
  /* Alt çizgi metni kadar; blok genişliğinde olursa çizgi gibi okunuyor. */
  align-self: flex-start;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}
.link-btn:hover { text-decoration-color: var(--ink-faint); }

/* ══ 4. Araç çubuğu ═══════════════════════════════════════════════════ */

.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--toolbar-h);
  padding: 0 16px 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.toolbar-left { display: flex; flex-direction: column; gap: 1px; min-width: 200px; }
.clinic-name { font-size: 14px; font-weight: 600; letter-spacing: -0.012em; }
.tz-note { font-size: 11px; color: var(--ink-faint); letter-spacing: .002em; }

.toolbar-center {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 auto;
}
/* Tarih alanı gezinmenin merkezi; ‹ › ile aynı yükseklikte dursun. */
.toolbar-center .date-input { padding: 6px 8px; }

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
  justify-content: flex-end;
}

/* Giriş yapan kişi + çıkış. `hidden` tek-kiracılı modda gizliyor, ve
   display:flex onu ezmesin diye [hidden] açıkça yeniden söyleniyor. */
.session-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}
.session-box[hidden] { display: none; }

/* ══ 5. Yerleşim ══════════════════════════════════════════════════════ */

.layout {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 0;
}

.patient-panel {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 18px 16px 16px;
  overflow-y: auto;
  /* Bir sütun, ki kanal şeridinin `margin-top: auto`'su onu hasta aramanın
     hemen altına değil panelin dibine oturtabilsin. */
  display: flex;
  flex-direction: column;
}

.calendar {
  padding: 20px 24px 32px;
  overflow: auto;
  min-width: 0;
}

/* ══ 6. Hasta paneli ══════════════════════════════════════════════════ */

.patient-search { margin: 14px 0 6px; display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 12px; color: var(--ink-soft); }

.patient-result { display: flex; flex-direction: column; }

.patient-name { font-size: 16px; margin-top: 18px; letter-spacing: -0.015em; }
.patient-phone {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.pkg-list, .up-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.pkg {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: var(--surface-sunk);
}
.pkg.is-empty { opacity: .55; }
.pkg-service { font-size: 12px; color: var(--ink-soft); }
.pkg-balance { font-weight: 600; font-size: 13px; }

.up-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 8px;
}
.up-item:last-child { border-bottom: 0; }
.up-meta { font-size: 12px; color: var(--ink-soft); }

/* ── WhatsApp bağlantı şeridi ─────────────────────────────────────────
 *
 * Bu ekranda sessizce bozulabilecek tek parça o, bu yüzden panelin dibinde
 * sürekli görünür. Tonu renkle değil, ağırlıkla söylüyor — tek istisna
 * gerçekten bozuk olan hâl.
 */

.channel-strip {
  margin-top: auto;
  padding: 12px 0 0;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--ink-soft);
}
.channel-strip:empty { border-top: none; }

.channel-line { display: flex; flex-direction: column; gap: 2px; }
.channel-line strong { font-weight: 600; color: var(--ink); }

.channel-strip.tone-ok strong { color: var(--ink); }
.channel-strip.tone-ok strong::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: #1b7a4b;
  vertical-align: 1px;
}
.channel-strip.tone-warn strong,
.channel-strip.tone-bad strong { color: var(--danger); }
.channel-strip.tone-muted strong { color: var(--ink-faint); }

/* Oturumdan ayrı bir arıza: bağlantı sağlam, süreç ölü. */
.channel-warn { color: var(--danger); font-weight: 600; }

.channel-qr { margin-top: 12px; }
.channel-qr img {
  width: 100%;
  max-width: 220px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
}

/* ══ 7. Gün başlığı ═══════════════════════════════════════════════════ */

.day-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 2px 14px;
}
.day-title { font-size: 20px; font-weight: 600; letter-spacing: -0.021em; }
.day-sub { color: var(--ink-soft); font-size: 12.5px; }

/* ══ 8. Izgara ════════════════════════════════════════════════════════ */

.grid {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  /* `clip`, `hidden`'ın aksine kaydırma bağlamı açmıyor — köşeler kırpılıyor
     ama başlık satırı `.calendar`'a göre yapışkan kalabiliyor. */
  overflow: clip;
}

.grid-head, .grid-body {
  display: grid;
  grid-template-columns: var(--gutter-w) repeat(var(--cols), minmax(0, 1fr));
}

.grid-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.gutter-head { border-right: 1px solid var(--line-soft); }

.col-head {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 10px 12px;
  border-left: 1px solid var(--line-soft);
  min-width: 0;
}
.col-name {
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: -0.008em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.col-role {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-faint);
}

/* İlk ve son saat etiketi yarısı dışarıda kalmasın diye küçük bir pay. */
.grid-body { padding: 12px 0 16px; }

.gutter {
  position: relative;
  border-right: 1px solid var(--line-soft);
  background: var(--surface);
}
.hour-label {
  position: absolute;
  right: 9px;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-faint);
  letter-spacing: .01em;
}

.col {
  position: relative;
  border-left: 1px solid var(--line-soft);
  background: var(--surface-sunk);
  cursor: copy;
}
/* Mesai içi beyaz, dışı çukur: gün sınırı çizgi çekmeden okunuyor. */
.working { position: absolute; left: 0; right: 0; background: var(--surface); }
.hour-line { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line-soft); }

/* ── "Şimdi" işareti ──────────────────────────────────────────────────
 *
 * Bu ekranın imzası. Sekreterin gün boyunca sorduğu tek soru "şu an
 * neredeyiz" — ekran sabah açılıp akşama kadar açık kaldığı için de
 * dakikada bir kendini güncelliyor (app.js · startNowTicker).
 *
 * Renk yok: koyu mürekkep. Renk bu ekranda durum demek.
 */

.col-past {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  background: rgba(25, 27, 31, .035);
  pointer-events: none;
}

.now {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1.5px solid var(--ink);
  z-index: 4;
  pointer-events: none;
}
.now::before {
  content: "";
  position: absolute;
  left: 0;
  top: -3.25px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
}

.now-cap {
  position: absolute;
  right: 7px;
  transform: translateY(-50%);
  z-index: 6;
  background: var(--ink);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .015em;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 4px;
}

/* ══ 9. Randevu blokları ══════════════════════════════════════════════ */

.appt {
  position: absolute;
  font: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  /* Sıkı dikey ritim: 45 dakikalık bir blok (≈50 px) üç satırı da almalı. */
  gap: 0;
  overflow: hidden;
  padding: 3px 7px;
  cursor: pointer;
  border: 1px solid var(--edge);
  border-left: 3px solid var(--c);
  border-radius: 6px;
  background: var(--soft);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  z-index: 2;
  transition: box-shadow .12s ease, transform .12s ease;
}
.appt:hover { box-shadow: 0 2px 6px rgba(22, 24, 30, .12); transform: translateY(-1px); }
.appt:focus-visible { box-shadow: var(--ring); }

.appt-time {
  font-size: 10.5px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: .015em;
  color: var(--c);
}
.appt-who { font-size: 12.5px; font-weight: 600; line-height: 1.25; letter-spacing: -0.008em; }
/* Tek satır: hizmet adı kısalır, cihaz rozeti asla kırpılmaz. */
.appt-meta {
  display: flex; flex-wrap: nowrap; align-items: center; gap: 5px;
  font-size: 11px; line-height: 15px; color: var(--ink-soft); min-width: 0;
}
.appt-service { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.appt-status {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--c);
  opacity: .75;
}

/* Kısa randevu: saat ve isim yan yana, hizmet/cihaz sığmıyorsa gizlenir. */
.appt.is-compact { flex-direction: row; align-items: baseline; gap: 6px; padding-right: 48px; }
.appt.is-compact .appt-meta { display: none; }
.appt.is-compact .appt-who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.badge.device {
  flex: 0 0 auto;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 500;
  line-height: 14px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .75);
  white-space: nowrap;
}

/*
 * Buffer: randevunun her iki yanında ayrılan temiz zaman. Çizilmezse
 * sekreter dolduramadığı boşluğu görür ve yazılımı bozuk sanar.
 * Tarama deseni + kesik kenar, bloğun kendisinden açıkça ayrı.
 */
.buffer {
  position: absolute;
  z-index: 1;
  border-radius: 5px;
  border: 1px dashed var(--edge);
  opacity: .55;
  background-image: repeating-linear-gradient(
    45deg,
    var(--c) 0 1px,
    transparent 1px 8px
  );
  background-color: rgba(255, 255, 255, .55);
  pointer-events: none;
}

/* ── Durum renkleri — tek yerden ──────────────────────────────────────
   --c kenar/etiket, --soft dolgu, --edge ince çerçeve. */
.st-scheduled { --c: #2c5fa8; --soft: #eaf0f9; --edge: #cddcef; }
.st-confirmed { --c: #1b7a4b; --soft: #e7f4ed; --edge: #c5e3d3; }
.st-completed { --c: #5c6672; --soft: #eef0f2; --edge: #dcdfe3; }
.st-no_show   { --c: #a9700f; --soft: #fbf2df; --edge: #ecdcb4; }
.st-cancelled { --c: #98a0aa; --soft: #f4f5f6; --edge: #e3e5e8; }
.st-held      { --c: #6e52b8; --soft: #f0ebfa; --edge: #ddd3f2; }

/* held = 10 dakikalık konuşma fitili, randevu değil: hayalet göster. */
.appt.st-held {
  border-style: dashed;
  border-left-style: dashed;
  background: repeating-linear-gradient(
    -45deg,
    rgba(110, 82, 184, .10) 0 6px,
    rgba(110, 82, 184, .02) 6px 12px
  );
  color: var(--ink-soft);
  font-style: italic;
}

.appt.st-cancelled { opacity: .6; box-shadow: none; }
.appt.st-cancelled .appt-who { text-decoration: line-through; }
.appt.st-completed .appt-who { color: var(--ink-soft); }

/* ══ 9b. Sürükleyerek taşıma ══════════════════════════════════════════
 *
 * Taşınabilir blok, taşınamayandan imleçle ayrılıyor: `grab` yalnız
 * `scheduled` ve `confirmed` üzerinde çıkıyor, geri kalanı `pointer`
 * kalıyor. Sekreter denemeden önce görüyor.
 */

.appt[data-movable] { cursor: grab; touch-action: none; }
.appt.is-dragged {
  cursor: grabbing;
  z-index: 8;
  opacity: .95;
  box-shadow: 0 14px 30px -10px rgba(22, 24, 30, .45);
  transform: scale(1.015);
  transition: none;
}
/* Sürükleme boyunca metin seçilmesin ve altındaki bloklar tepki vermesin. */
body.is-dragging { user-select: none; -webkit-user-select: none; }
body.is-dragging .appt:not(.is-dragged) { pointer-events: none; }
body.is-dragging .col { cursor: grabbing; }

/* Bırakılamaz: o saatte personel ya da cihaz başka bir randevuda.
   Bırakmadan önce görünüyor, "dene-reddedil" döngüsünü bitiriyor. */
.appt.is-blocked {
  box-shadow: 0 0 0 2px var(--danger);
  cursor: not-allowed;
}
.appt.is-blocked::after {
  content: "dolu";
  position: absolute;
  left: 7px;
  bottom: 2px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--danger);
}

/* İptal bölgesinin üstündeyken blok kendi akıbetini gösteriyor. */
.appt.is-doomed {
  opacity: .5;
  filter: grayscale(1);
  box-shadow: 0 0 0 2px var(--danger);
}

.drop-cancel {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 320px;
  padding: 14px 26px;
  text-align: center;
  background: var(--surface);
  border: 1.5px dashed var(--danger-edge);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  pointer-events: none;
}
.drop-cancel[hidden] { display: none; }
.drop-cancel-title { font-size: 13.5px; font-weight: 600; color: var(--danger); }
.drop-cancel-note { font-size: 11.5px; color: var(--ink-faint); }

.drop-cancel.is-armed {
  background: var(--danger);
  border-color: var(--danger);
  border-style: solid;
}
.drop-cancel.is-armed .drop-cancel-title { color: #fff; }
.drop-cancel.is-armed .drop-cancel-note { color: rgba(255, 255, 255, .8); }

/* ══ 9c. Onay penceresi ═══════════════════════════════════════════════ */

.confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(22, 24, 30, .3);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.confirm-backdrop[hidden] { display: none; }

.confirm {
  position: fixed;
  top: 22vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 31;
  width: 400px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  padding: 22px 22px 18px;
}
.confirm[hidden] { display: none; }
.confirm-title { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }
.confirm-detail { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
.confirm-row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ══ 10. Cihaz doluluk şeridi ═════════════════════════════════════════ */

.util-strip {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 14px 16px 16px;
}
.util-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 9px 24px; margin-top: 12px; }
.util-item { display: grid; grid-template-columns: 128px 1fr auto; align-items: center; gap: 10px; font-size: 12px; }
.util-name { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.util-bar { height: 6px; background: #ebebe7; border-radius: 999px; overflow: hidden; }
.util-fill { height: 100%; background: var(--ink); border-radius: 999px; opacity: .78; }
.util-val { color: var(--ink-faint); font-size: 11.5px; }

/* ══ 11. Hafta görünümü ═══════════════════════════════════════════════ */

.week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}
.week-col {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  min-height: 260px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.week-col.is-closed { background: var(--surface-sunk); box-shadow: none; }
/* Bugün: renk değil, mürekkep kenarı. */
.week-col.is-today { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), var(--shadow-card); }

.week-head {
  font: inherit;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: none;
  padding: 10px 10px 9px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
  transition: background .12s ease;
}
.week-head:hover { background: var(--surface-hover); }
.week-weekday { font-weight: 600; font-size: 12.5px; letter-spacing: -0.008em; }
.week-date { font-size: 11px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.week-col.is-today .week-weekday::after {
  content: "";
  display: inline-block;
  width: 4px; height: 4px;
  margin-left: 5px;
  border-radius: 50%;
  background: var(--ink);
  vertical-align: 3px;
}

.week-closed, .week-empty { margin: 16px 10px; font-size: 11.5px; color: var(--ink-faint); text-align: center; }
.week-closed { font-weight: 600; color: var(--ink-soft); }

.week-list { display: flex; flex-direction: column; gap: 5px; padding: 8px; overflow-y: auto; }
.week-item {
  font: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--edge);
  border-left: 3px solid var(--c);
  border-radius: 6px;
  background: var(--soft);
  padding: 5px 7px;
  cursor: pointer;
  transition: box-shadow .12s ease;
}
.week-item:hover { box-shadow: 0 2px 6px rgba(22, 24, 30, .12); }
.week-item.st-held { border-style: dashed; font-style: italic; }
.week-item.st-cancelled { opacity: .6; }
.week-item.st-cancelled .week-who { text-decoration: line-through; }
.week-time { font-size: 10.5px; font-weight: 700; letter-spacing: .015em; color: var(--c); }
.week-who { font-size: 12px; font-weight: 600; letter-spacing: -0.008em; }
.week-meta { font-size: 11px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ══ 12. Durum kutuları ═══════════════════════════════════════════════ */

.state-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 40px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.state-box.inline { margin-top: 14px; padding: 20px; box-shadow: none; }
.state-box.closed { border-style: dashed; background: var(--surface-sunk); box-shadow: none; }
.state-title { margin: 0; font-weight: 600; font-size: 15px; letter-spacing: -0.012em; }
.state-box p { margin: 0; max-width: 46ch; }
.state-box .btn { margin-top: 6px; }

/* ══ 13. Yan paneller (drawer) ════════════════════════════════════════ */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(22, 24, 30, .22);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 10;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 92vw;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
  z-index: 11;
  display: flex;
  flex-direction: column;
}
.drawer[hidden] { display: none; }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 14px 20px;
  border-bottom: 1px solid var(--line-soft);
  flex: 0 0 auto;
}
.drawer-head .panel-title {
  text-transform: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.014em;
}
.drawer-body { padding: 18px 20px 24px; overflow-y: auto; }

.facts {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
  padding-bottom: 4px;
}
.facts dt { color: var(--ink-soft); font-size: 12px; }
.facts dd { margin: 0; font-size: 13px; }

.action-row { display: flex; gap: 8px; margin-top: 18px; }
.action-row .btn { flex: 1; }

.pay-form { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.radio-row { display: flex; gap: 16px; }
.radio { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.radio input { accent-color: var(--ink); }

/* ── Yeni randevu paneli ── */

.slot-box { display: flex; flex-direction: column; gap: 10px; }

/* Saatler ızgara: sekreter telefondayken göz taramayla saat arıyor, tek
   sütunlu bir liste yarım günü ekran dışına iterdi. */
.slot-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 6px;
  max-height: 244px;
  overflow-y: auto;
  padding: 1px;
}

.slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 7px 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  transition: background .12s ease, border-color .12s ease;
}
.slot:hover { background: var(--surface-hover); border-color: #d4d4ce; }
.slot.is-chosen { background: var(--ink); border-color: var(--ink); color: #fff; }
.slot-time { font-size: 13px; font-weight: 500; }
.slot-staff { font-size: 10.5px; opacity: .7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.booking-patient { display: flex; flex-direction: column; gap: 10px; }
.phone-row { display: flex; gap: 6px; }
.phone-row .text-input { flex: 1; }
.found-name { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }

/* ══ 14. Toast ════════════════════════════════════════════════════════ */

.toasts {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 20;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: var(--shadow-pop);
  transition: opacity .3s ease, transform .3s ease;
}
.toast.ok::before,
.toast.error::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  vertical-align: 1px;
}
.toast.ok::before { background: #4ade80; }
.toast.error { background: var(--danger); }
.toast.error::before { background: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ══ 15. Kaydırma çubukları ═══════════════════════════════════════════ */

.calendar, .patient-panel, .drawer-body, .slot-list, .week-list { scrollbar-width: thin; }
:is(.calendar, .patient-panel, .drawer-body, .slot-list, .week-list)::-webkit-scrollbar { width: 10px; height: 10px; }
:is(.calendar, .patient-panel, .drawer-body, .slot-list, .week-list)::-webkit-scrollbar-thumb {
  background: rgba(25, 27, 31, .16);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 999px;
}
:is(.calendar, .patient-panel, .drawer-body, .slot-list, .week-list)::-webkit-scrollbar-thumb:hover {
  background: rgba(25, 27, 31, .28);
  border: 3px solid transparent;
  background-clip: content-box;
}

/* ══ 16. Dar ekran ════════════════════════════════════════════════════ */

@media (max-width: 1180px) {
  .toolbar-left, .toolbar-right { min-width: 0; }
  .week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1000px) {
  .toolbar { height: auto; flex-wrap: wrap; gap: 10px 12px; padding: 10px 14px; }
  .toolbar-center { margin: 0; }
  .layout { grid-template-columns: 1fr; }
  /* Panel üste geçince form ekranı boydan boya germesin. */
  .patient-panel { border-right: 0; border-bottom: 1px solid var(--line); padding: 14px; }
  .patient-search, .patient-result, .channel-strip { max-width: 380px; }
  .calendar { padding: 16px 14px 28px; }
  .week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ══ 17. Hareket tercihi ══════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .appt:hover { transform: none; }
}
