/* KLİNİK — Outlook benzeri randevu görünümü v46 */
.appointment-head { align-items: center; }
.view-switch,
.calendar-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-container);
}
.temporary-summary {
  margin: 0 0 12px;
  padding: 10px 13px;
  border: 1px solid #f3c568;
  border-left: 4px solid #f59e0b;
  border-radius: 10px;
  background: #fff8e7;
  color: #6b4b00;
  font-size: 12.5px;
}
/* İkincil düğmeler: geniş ekranda başlık satırında yan yana durur
   ("display: contents" ile sarmalayıcılar görünmez), dar ekranda
   "⋯ Araçlar" düğmesinin altında açılan bir menüye dönüşür. */
.rnd-arac-sar, .rnd-araclar { display: contents; }
#btn-arac { display: none; }

.calendar-find-bar {
  position: relative;
  z-index: 25;
  display: grid;
  grid-template-columns: minmax(180px, 230px) minmax(300px, 1fr);
  gap: 12px;
  align-items: end;
  margin: 0 0 12px;
  padding: 11px 13px;
  border: 1px solid var(--stroke-soft);
  border-radius: 13px;
  background: var(--surface-lowest);
  box-shadow: 0 2px 9px rgba(23, 35, 49, .04);
}
.calendar-find-bar label {
  display: block;
  color: var(--outline);
  font-size: 10.5px;
  font-weight: 700;
}
.calendar-find-bar input {
  width: 100%;
  min-height: 40px;
  margin-top: 5px;
  padding: 8px 11px;
  border: 1px solid var(--stroke-soft);
  border-radius: 9px;
  color: var(--on-surface);
  background: var(--surface-container-lowest, #fff);
  outline: none;
}
.calendar-find-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(3, 155, 229, .11);
}
.calendar-patient-search { position: relative; }
.calendar-date-jump,
.calendar-patient-search,
.calendar-patient-search-input,
.calendar-patient-search-input input { min-width: 0; }
.calendar-patient-search-input { display: flex; gap: 7px; align-items: center; }
.calendar-patient-search-input .btn { flex: 0 0 auto; min-height: 40px; }
.calendar-patient-suggestions {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  z-index: 60;
  overflow: auto;
  max-height: 310px;
  padding: 5px;
  border: 1px solid var(--stroke-soft);
  border-radius: 11px;
  background: var(--surface-lowest);
  box-shadow: 0 14px 34px rgba(23, 35, 49, .18);
}
.calendar-patient-suggestions button {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--on-surface);
  background: transparent;
  text-align: left;
}
.calendar-patient-suggestions button:hover,
.calendar-patient-suggestions button:focus-visible { background: var(--surface-container); outline: none; }
.calendar-patient-suggestions button b { font-size: 12px; }
.calendar-patient-suggestions button span,
.calendar-patient-no-result { color: var(--outline); font-size: 10.5px; }
.calendar-patient-no-result { padding: 12px; text-align: center; }

.calendar-patient-filter {
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid #9bcddd;
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  background: #f1faff;
}
.calendar-filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.calendar-filter-summary b { display: block; font-size: 13px; }
.calendar-filter-summary span { display: block; margin-top: 2px; color: var(--outline); font-size: 10.5px; }
.calendar-filter-dates {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  margin-top: 10px;
  padding: 2px 0 5px;
  scrollbar-width: thin;
}
.calendar-filter-dates button {
  flex: 0 0 auto;
  min-width: 145px;
  padding: 8px 10px;
  border: 1px solid #b8dce8;
  border-radius: 9px;
  color: #17485a;
  background: #fff;
  text-align: left;
}
.calendar-filter-dates button:hover { border-color: var(--primary); background: #eaf7fc; }
.calendar-filter-dates button b,
.calendar-filter-dates button span { display: block; }
.calendar-filter-dates button b { font-size: 11px; }
.calendar-filter-dates button span { margin-top: 2px; color: var(--outline); font-size: 9.5px; }
.calendar-filter-empty { padding: 8px 2px; color: var(--outline); font-size: 11px; }
#takvim-kutu.takvim-yukleniyor { opacity: .52; pointer-events: none; transition: opacity .14s ease; }

.schedule-priority {
  margin: 0 0 12px;
  padding: 10px 13px;
  border: 1px solid #b8dfd0;
  border-left: 4px solid #16815f;
  border-radius: 10px;
  background: #f0fbf7;
  color: #235546;
  font-size: 12px;
}
.schedule-priority > summary { cursor: pointer; list-style: none; }
.schedule-priority > summary::-webkit-details-marker { display: none; }
.schedule-priority > summary::after { content: " ⌄"; opacity: .6; }
.schedule-priority[open] > summary::after { content: " ⌃"; }
.outlook-scroll {
  width: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--stroke-soft);
  border-radius: 12px;
  background: var(--surface-lowest);
  max-height: calc(100vh - 230px);
}
.outlook-calendar {
  display: grid;
  grid-template-columns: 62px repeat(var(--gun-sayisi), minmax(140px, 1fr));
  position: relative;
}
.outlook-corner,
.outlook-day-head {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 58px;
  border: 0;
  border-bottom: 1px solid var(--stroke-soft);
  background: var(--surface-lowest);
}
.outlook-day-head small {
  position: absolute;
  right: 5px;
  bottom: 3px;
  left: 5px;
  overflow: hidden;
  color: var(--outline);
  font-size: 8px;
  font-weight: 650;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.outlook-day-head.policy-oncelikli { box-shadow: inset 0 -3px #49a886; }
.outlook-day-head.policy-onayli { box-shadow: inset 0 -3px #d89c21; }
.outlook-day-head.policy-onay-gerekli,
.outlook-day-head.policy-pazar { background: #f4f5f6; }
.outlook-corner {
  left: 0;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
  color: var(--outline);
  font: 10px var(--font-mono);
}
.outlook-day-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  color: var(--on-surface);
  border-left: 1px solid var(--stroke-soft);
}
.outlook-day-head span {
  color: var(--outline);
  font: 10px var(--font-mono);
  text-transform: uppercase;
}
.outlook-day-head b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
}
.outlook-day-head.today b { background: var(--primary); color: #fff; }
.outlook-times {
  position: sticky;
  left: 0;
  z-index: 15;
  background: var(--surface-lowest);
  border-right: 1px solid var(--stroke-soft);
}
.outlook-times span {
  position: absolute;
  left: 0;
  right: 7px;
  transform: translateY(-7px);
  text-align: right;
  color: var(--outline);
  font: 10px var(--font-mono);
}
.outlook-day-body {
  position: relative;
  border-right: 1px solid var(--stroke-soft);
  background:
    repeating-linear-gradient(to bottom,
      transparent 0,
      transparent 31px,
      rgba(116, 119, 126, .10) 31px,
      rgba(116, 119, 126, .10) 32px,
      transparent 32px,
      transparent 63px,
      rgba(116, 119, 126, .18) 63px,
      rgba(116, 119, 126, .18) 64px);
}
.outlook-day-body.today { background-color: rgba(3, 155, 229, .025); }
.outlook-slot {
  position: absolute;
  left: 3px;
  right: 3px;
  z-index: 1;
  overflow: hidden;
  border: 1px dashed transparent;
  border-radius: 5px;
  background: transparent;
  color: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 10px;
  transition: .12s ease;
}
.outlook-slot:hover,
.outlook-slot:focus-visible {
  z-index: 5;
  border-color: var(--primary);
  background: rgba(3, 155, 229, .08);
  color: var(--primary);
  outline: none;
}
.outlook-slot span { padding-left: 5px; }
.outlook-event {
  position: absolute;
  left: 4px;
  right: 4px;
  z-index: 8;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 4px 6px;
  border: 0;
  border-left: 4px solid var(--c-diger);
  border-radius: 6px;
  background: #eef2f6;
  color: var(--on-surface);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.outlook-event:hover { filter: brightness(.97); z-index: 10; }
.outlook-event b {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
.outlook-event span {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9.5px;
}
.outlook-event.usg { border-left-color: var(--c-usg); background: #eaf1ff; }
.outlook-event.varis { border-left-color: var(--c-varis); background: #fff0ef; }
.outlook-event.biyopsi { border-left-color: var(--c-biyopsi); background: #f4edff; }
.outlook-event.mezo { border-left-color: var(--c-mezo); background: #fff6df; }
.outlook-event.muayene { border-left-color: var(--c-muayene); background: #e8f7fa; }
.outlook-event.gecici { outline: 1px dashed #d39200; outline-offset: -1px; }
.outlook-event.iptal { opacity: .48; text-decoration: line-through; }
.outlook-closed {
  position: absolute;
  left: 3px;
  right: 3px;
  z-index: 6;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 5px 7px;
  border: 1px solid #9aa0a8;
  border-left: 4px solid #59636e;
  border-radius: 6px;
  background:
    repeating-linear-gradient(135deg, #eef0f2 0, #eef0f2 8px, #e3e6e9 8px, #e3e6e9 16px);
  color: #3f4852;
  cursor: pointer;
  text-align: left;
}
.outlook-closed:hover { filter: brightness(.97); z-index: 10; }
.outlook-closed b { font-size: 10.5px; }
.outlook-closed span {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9.5px;
}
.outlook-policy-closed {
  position: absolute;
  right: 3px;
  left: 3px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding: 28px 8px 8px;
  border: 0;
  border-radius: 6px;
  background:
    repeating-linear-gradient(135deg, rgba(231, 234, 237, .92) 0, rgba(231, 234, 237, .92) 10px, rgba(241, 243, 245, .92) 10px, rgba(241, 243, 245, .92) 20px);
  color: #515961;
  text-align: center;
}
button.outlook-policy-closed { cursor: pointer; }
button.outlook-policy-closed:hover {
  z-index: 7;
  background: #fff4d9;
  color: #725000;
}
.outlook-policy-closed b { font-size: 11px; }
.outlook-policy-closed span { max-width: 130px; font-size: 9px; }
.outlook-policy-approved {
  position: absolute;
  top: 4px;
  right: 4px;
  left: 4px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  padding: 4px 6px;
  border: 1px solid #e5bf6a;
  border-radius: 5px;
  background: #fff8e5;
  color: #735515;
  pointer-events: none;
}
.outlook-policy-approved b { font-size: 9.5px; }
.outlook-policy-approved span {
  overflow: hidden;
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.outlook-day-body.policy-oncelikli { background-color: rgba(44, 151, 114, .018); }
.calendar-policy-mini {
  border-left: 3px solid #8b9299 !important;
  background: #f0f2f4 !important;
  color: #59616a !important;
}
.calendar-policy-mini.approved {
  border-left-color: #d89c21 !important;
  background: #fff5dc !important;
  color: #735515 !important;
}
.calendar-policy-mini.sunday { opacity: .72; }
.cal-ay-hucre.policy-oncelikli { box-shadow: inset 0 3px rgba(73, 168, 134, .45); }
.cal-ay-hucre.policy-onay-gerekli,
.cal-ay-hucre.policy-pazar { background-color: rgba(89, 99, 110, .04); }
.calendar-closure-mini {
  border-left-color: #59636e !important;
  background: #e7eaed !important;
  color: #3f4852 !important;
}
.cal-ay-hucre.has-closure { background-color: rgba(89, 99, 110, .045); }
.outlook-help { padding: 8px 2px 0; }
.cal-ay-hucre button.mini {
  display: block;
  width: 100%;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  text-align: left;
  cursor: pointer;
}
.calendar-mobile { display: block; }
.calendar-desktop { display: none; }

@media (min-width: 641px) {
  .appointment-head {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto auto;
    gap: 10px;
  }
  .appointment-head .view-switch {
    display: grid;
    grid-template-columns: repeat(3, minmax(82px, 1fr));
    border-radius: 13px;
  }
  .appointment-head .view-switch .btn { min-height: 38px; border-radius: 10px; }
  .appointment-head #btn-gun-izni,
  .appointment-head #btn-takvim-kapat,
  .appointment-head #btn-hatirlatma-sirasi,
  .appointment-head #btn-ics,
  .appointment-head #btn-rnd-yeni { min-height: 38px; }
  .mobile-week-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .mobile-day-list {
    width: min(100%, 980px);
    margin-inline: auto;
  }
  .mobile-day-card {
    overflow: hidden;
    border: 1px solid var(--stroke-soft);
    border-radius: 14px;
    background: var(--surface-lowest);
    box-shadow: 0 2px 10px rgba(23, 35, 49, .045);
  }
  .mobile-day-card.today {
    border-color: rgba(3, 155, 229, .4);
    box-shadow: inset 5px 0 var(--primary), 0 3px 14px rgba(3, 104, 153, .08);
  }
  .mobile-day-card.policy-pazar,
  .mobile-day-card.policy-onay-gerekli { background: #fafbfc; }
  .mobile-day-head {
    display: grid;
    grid-template-columns: 58px 1fr auto;
    align-items: center;
    gap: 10px;
    min-height: 72px;
    padding: 10px 16px;
    cursor: pointer;
  }
  .mobile-day-number {
    color: var(--primary);
    font-size: 38px;
    font-weight: 760;
    line-height: 1;
    text-align: center;
  }
  .mobile-day-name b,
  .mobile-day-name small { display: block; }
  .mobile-day-name b { font-size: 15px; }
  .mobile-day-name small,
  .mobile-day-count { color: var(--outline); font-size: 10.5px; }
  .mobile-day-count { font-weight: 700; }
  .mobile-day-policy-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 0 15px 6px;
  }
  .mobile-policy {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 7px;
    border: 0;
    border-radius: 999px;
    font: 700 9px var(--font-sans);
  }
  button.mobile-policy { cursor: pointer; }
  .mobile-policy.preferred { background: #eaf8f2; color: #176a50; }
  .mobile-policy.approved,
  .mobile-policy.permission { background: #fff3d2; color: #765100; }
  .mobile-policy.closed { background: #eceff2; color: #59616a; }
  .mobile-policy.closure { background: #e5e8eb; color: #3f4852; }
  .mobile-day-appointments {
    display: grid;
    gap: 6px;
    padding: 0 10px 10px;
  }
  .mobile-appointment {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto 16px;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-height: 58px;
    padding: 8px 10px;
    border: 0;
    border-left: 4px solid var(--c-diger);
    border-radius: 9px;
    background: #eef2f6;
    color: var(--on-surface);
    cursor: pointer;
    text-align: left;
    transition: transform .12s ease, filter .12s ease;
  }
  .mobile-appointment:hover { filter: brightness(.975); transform: translateX(2px); }
  .mobile-appointment.usg { border-left-color: var(--c-usg); background: #eaf1ff; }
  .mobile-appointment.varis { border-left-color: var(--c-varis); background: #fff0ef; }
  .mobile-appointment.biyopsi { border-left-color: var(--c-biyopsi); background: #f4edff; }
  .mobile-appointment.mezo { border-left-color: var(--c-mezo); background: #fff6df; }
  .mobile-appointment.muayene { border-left-color: var(--c-muayene); background: #e8f7fa; }
  .mobile-appointment.gecici { outline: 1px dashed #d39200; outline-offset: -2px; }
  .mobile-appointment.iptal { opacity: .5; text-decoration: line-through; }
  .mobile-appointment-time { color: var(--primary); font: 750 14px var(--font-mono); }
  .mobile-appointment-main,
  .mobile-appointment-main b,
  .mobile-appointment-main small,
  .mobile-appointment-meta small { display: block; min-width: 0; }
  .mobile-appointment-main b,
  .mobile-appointment-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-appointment-main b { font-size: 12px; }
  .mobile-appointment-main small,
  .mobile-appointment-meta small { margin-top: 2px; color: var(--outline); font-size: 9px; }
  .mobile-appointment-meta { color: var(--outline); font-size: 9.5px; text-align: right; }
  .mobile-appointment-arrow { color: var(--outline); font-size: 23px; }
  .mobile-day-empty { padding: 12px 9px; color: var(--outline); font-size: 11px; }
  .mobile-quick-add {
    width: 100%;
    min-height: 40px;
    border: 0;
    border-top: 1px solid var(--stroke-soft);
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    font-size: 11px;
    font-weight: 750;
  }
  .mobile-quick-add:hover { background: rgba(3, 155, 229, .05); }
  .mobile-month {
    overflow: hidden;
    border: 1px solid var(--stroke-soft);
    border-radius: 14px;
    background: var(--surface-lowest);
  }
  .mobile-month-weekdays,
  .mobile-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
  .mobile-month-weekdays span {
    padding: 12px 4px;
    color: var(--outline);
    font-size: 10px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
  }
  .mobile-month-weekdays span:nth-child(n+6) { color: #c96e72; }
  .mobile-month-day {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    min-height: 112px;
    padding: 8px;
    border: 0;
    border-top: 1px solid var(--stroke-soft);
    border-right: 1px solid var(--stroke-soft);
    background: #fff;
    color: var(--on-surface);
    cursor: pointer;
    text-align: left;
  }
  .mobile-month-day:nth-child(7n) { border-right: 0; }
  .mobile-month-day:hover { background: var(--surface-light); }
  .mobile-month-day.outside { opacity: .32; }
  .mobile-month-day.policy-pazar,
  .mobile-month-day.policy-onay-gerekli { background: #fafbfc; }
  .mobile-month-day.today { box-shadow: inset 0 0 0 2px var(--primary); }
  .mobile-month-number { color: var(--primary); font-size: 14px; font-weight: 800; }
  .mobile-month-day:nth-child(7n) .mobile-month-number { color: #c96e72; }
  .mobile-month-lock { position: absolute; top: 7px; right: 6px; font-size: 10px; }
  .mobile-month-event {
    overflow: hidden;
    display: block;
    width: 100%;
    padding: 4px 6px;
    border-radius: 5px;
    background: #eaf1ff;
    color: #17447d;
    font-size: 9px;
    line-height: 1.2;
  }
  .mobile-month-event.varis { background: #fff0ef; color: #8b3935; }
  .mobile-month-event.biyopsi { background: #f4edff; color: #63408d; }
  .mobile-month-event.mezo { background: #fff6df; color: #765b13; }
  .mobile-month-event.muayene { background: #e8f7fa; color: #21636d; }
  .mobile-month-event b,
  .mobile-month-event small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-month-more { color: var(--primary); font-size: 9px; font-weight: 800; }
}

@media (min-width: 1120px) {
  .mobile-week-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mobile-week-list .mobile-day-card.today { grid-column: span 2; }
}

.appointment-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.appointment-mode label { cursor: pointer; }
.appointment-mode input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.appointment-mode span {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 62px;
  padding: 11px 13px;
  border: 1px solid var(--stroke-soft);
  border-radius: 10px;
  background: var(--surface-lowest);
}
.appointment-mode input:checked + span {
  border-color: var(--primary);
  background: rgba(3, 155, 229, .07);
  box-shadow: 0 0 0 1px var(--primary);
}
.appointment-mode small { color: var(--outline); }
.temporary-fields {
  margin-bottom: 14px;
  padding: 13px 13px 2px;
  border: 1px dashed #d39200;
  border-radius: 10px;
  background: #fffbef;
}
.temporary-fields .f-title { color: #855b00; margin-top: 0; }
.quick-topic-fields {
  margin: -2px 0 14px;
  padding: 13px 13px 2px;
  border: 1px dashed var(--primary);
  border-radius: 10px;
  background: rgba(3, 155, 229, .045);
}
.quick-topic-fields .f-title { color: var(--primary); margin-top: 0; }
.temporary-detail {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
  padding: 11px;
  border: 1px dashed #d39200;
  border-radius: 10px;
  background: #fffbef;
}
.temporary-detail .chip { margin-left: 7px; font-size: 9.5px; }
.patient-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 12px;
  padding: 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.patient-link:hover { background: var(--surface-light); }
.patient-link > span:nth-child(2) { flex: 1; }
.patient-link small { display: block; color: var(--outline); }
.conversion-note {
  margin-bottom: 13px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--surface-light);
  font-size: 12.5px;
}
.closure-note {
  margin-bottom: 14px;
  padding: 11px 12px;
  border-left: 4px solid #59636e;
  border-radius: 8px;
  background: #eef0f2;
  color: #3f4852;
  font-size: 12px;
}
.permission-note {
  margin-bottom: 14px;
  padding: 11px 12px;
  border-left: 4px solid #d89c21;
  border-radius: 8px;
  background: #fff8e5;
  color: #6a5019;
  font-size: 12px;
}
.appointment-day-policy {
  margin: -2px 0 12px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 650;
}
.appointment-day-policy.is-open { background: #eaf8f2; color: #176a50; }
.appointment-day-policy.is-closed { background: #f2f3f4; color: #b3261e; }

.birthday-card {
  width: min(360px, 100%);
  margin: -4px 0 14px auto;
  border-color: #f0c55b;
  background: linear-gradient(135deg, #fffdf7, #fff8e7);
}
.birthday-compact > summary {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 9px 12px;
  cursor: pointer;
  list-style: none;
}
.birthday-compact > summary::-webkit-details-marker { display: none; }
.birthday-compact-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  font-size: 19px;
}
.birthday-compact-text,
.birthday-compact-text b,
.birthday-compact-text small { display: block; min-width: 0; }
.birthday-compact-text b { font-size: 12.5px; }
.birthday-compact-text small {
  overflow: hidden;
  margin-top: 2px;
  color: var(--outline);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.birthday-compact-count {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 999px;
  background: #f0c55b;
  color: #5f4708;
  font-size: 11px;
  font-weight: 800;
}
.birthday-compact[open] > summary { border-bottom: 1px solid rgba(138, 105, 22, .16); }
.birthday-compact > .card-body {
  overflow: auto;
  max-height: min(68vh, 620px);
  padding: 8px 12px 12px;
}
.birthday-stat-card {
  position: static;
  overflow: hidden;
  width: auto;
  min-width: 0;
  margin: 0;
}
.birthday-stat-card .birthday-compact > summary {
  min-height: 98px;
  padding: 14px 18px;
}
.birthday-stat-card .birthday-compact > .card-body {
  position: static;
  width: 100%;
  max-height: none;
  border: 0;
  border-top: 1px solid rgba(138, 105, 22, .16);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.birthday-stat-card .birthday-compact[open] > summary { border-bottom: 0; }
.birthday-stat-card .birthday-row {
  grid-template-columns: 32px minmax(0, 1fr);
}
.birthday-stat-card .birthday-row .birthday-send,
.birthday-stat-card .birthday-row .birthday-open {
  grid-column: 2;
  justify-self: start;
}
.birthday-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
}
.birthday-title h3 { margin: 0; }
.birthday-title span {
  display: block;
  margin-top: 2px;
  color: var(--outline);
  font-size: 11px;
  font-weight: 500;
}
.birthday-row {
  display: grid;
  grid-template-columns: 38px minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(138, 105, 22, .14);
}
.birthday-row:last-of-type { border-bottom: 0; }
.birthday-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  font-size: 19px;
}
.birthday-person { min-width: 0; }
.birthday-person b,
.birthday-person span,
.birthday-person small { display: block; }
.birthday-person span,
.birthday-person small {
  margin-top: 2px;
  color: var(--outline);
  font-size: 10.5px;
}
.birthday-person small { color: var(--error); }
.birthday-message-settings {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(138, 105, 22, .18);
}
.birthday-message-settings summary {
  cursor: pointer;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}
.birthday-message-settings[open] summary { margin-bottom: 10px; }
.birthday-empty { padding: 18px 8px; }

.appointment-settings-card { order: 2; }
.appointment-settings-head,
.appointment-setting-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 86px minmax(115px, .6fr) 72px 36px;
  gap: 7px;
  align-items: center;
}
.appointment-settings-head {
  padding: 0 2px 5px;
  color: var(--outline);
  font: 9.5px var(--font-mono);
  text-transform: uppercase;
}
.appointment-setting-row {
  padding: 7px 0;
  border-top: 1px solid var(--stroke-soft);
}
.appointment-setting-row input,
.appointment-setting-row select { min-width: 0; padding: 7px 8px; }
.appointment-setting-row > label { margin: 0; }
.appointment-setting-row > label > span { display: none; }
.appointment-setting-row .setting-active {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}
.appointment-setting-row .setting-active input { width: 17px; height: 17px; }
.calendar-settings {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--stroke-soft);
}
.calendar-settings h4 { margin: 0 0 8px; font-size: 12.5px; }

/* Tabletlerde ana içerik, sabit sol menü nedeniyle ekran genişliğinden daha
   dardır. Tarih ve hasta arama alanlarını tablet yatay görünümünde de alt alta
   alarak tarih girişinin arama kutusuna taşmasını önle. */
@media (max-width: 1180px) {
  .calendar-find-bar {
    grid-template-columns: minmax(0, 1fr);
  }
  .calendar-date-jump { width: min(100%, 260px); }
}

@media (max-width: 900px) {
  .appointment-head .grow { flex-basis: calc(100% - 10px); }
  .appointment-head .view-switch { order: 2; }
  .appointment-head .calendar-nav { order: 3; }
  .appointment-head #btn-gun-izni,
  .appointment-head #btn-takvim-kapat { order: 4; }
  .appointment-head #btn-rnd-yeni { order: 4; margin-left: auto; }
  .outlook-scroll { max-height: calc(100dvh - 285px); }
  .outlook-slot { color: rgba(3, 104, 153, .72); }
  .outlook-slot span { opacity: .62; }
}

@media (max-width: 640px) {
  .calendar-find-bar {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 9px;
    border-radius: 11px;
  }
  .calendar-find-bar label { font-size: 9.5px; }
  .calendar-date-jump { width: 100%; }
  .calendar-find-bar input { min-height: 38px; padding-inline: 8px; font-size: 11px; }
  .calendar-patient-search-input .btn { min-height: 38px; padding-inline: 8px; font-size: 10px; }
  .calendar-patient-suggestions {
    position: fixed;
    top: 50%;
    right: 12px;
    left: 12px;
    max-height: 55dvh;
    transform: translateY(-50%);
  }
  .calendar-filter-summary { align-items: flex-start; }
  .calendar-filter-summary .btn { min-height: 34px; padding-inline: 8px; font-size: 9.5px; }
  .calendar-filter-dates button { min-width: 132px; }
  .birthday-card {
    width: 100%;
    margin-top: 0;
  }
  .birthday-stat-card { width: auto; }
  .birthday-stat-card .birthday-compact > summary {
    min-height: 88px;
    padding: 12px;
  }
  .birthday-stat-card .birthday-compact > .card-body {
    position: static;
    width: 100%;
    max-height: none;
  }
  .birthday-compact > .card-body { max-height: 65dvh; }
  .calendar-desktop { display: none; }
  .calendar-mobile { display: block; }
  .appointment-head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
  }
  .appointment-head .view-switch {
    grid-column: 1 / 3;
    order: initial;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    padding: 4px;
    border-radius: 14px;
  }
  /* Şerit incelsin: takvim için yer açar */
  .appointment-head .view-switch { padding: 3px; border-radius: 11px; }
  .appointment-head .view-switch .btn {
    min-height: 32px;
    border-radius: 9px;
    font-size: 11.5px;
    padding-inline: 6px;
  }
  .appointment-head .calendar-nav { padding: 2px; }
  .appointment-head .calendar-nav .btn { min-height: 30px; font-size: 11.5px; padding-inline: 8px; }
  .appointment-head .calendar-nav .btn-icon { width: 30px; padding: 0; }
  .appointment-head #btn-arac { min-height: 30px; font-size: 11.5px; }
  .appointment-head .calendar-nav {
    grid-column: 1 / 2;
    order: initial;
    justify-self: start;
  }
  /* "Yeni Randevu" ekranın sağ altında sabit yuvarlak düğme olur:
     takvimden yer çalmaz, her zaman parmak menzilindedir. */
  .appointment-head #btn-rnd-yeni {
    position: fixed;
    right: 14px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 74px);
    z-index: 40;
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(3, 104, 153, .32);
  }
  .appointment-head #btn-rnd-yeni span { display: none; }
  .appointment-head #btn-rnd-yeni svg { width: 24px; height: 24px; }

  /* İkincil düğmeler "⋯ Araçlar" menüsüne toplanır */
  .appointment-head .rnd-arac-sar {
    display: block;
    position: relative;
    grid-column: 2 / 3;
    justify-self: end;
  }
  .appointment-head #btn-arac { display: inline-flex; }
  .appointment-head .rnd-araclar {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 50;
    flex-direction: column;
    gap: 7px;
    min-width: 200px;
    padding: 10px;
    border: 1px solid var(--stroke-soft);
    border-radius: 14px;
    background: var(--surface-lowest);
    box-shadow: 0 10px 26px rgba(23, 35, 49, .16);
  }
  .appointment-head .rnd-araclar.acik { display: flex; }
  .appointment-head .rnd-araclar .btn {
    width: 100%;
    justify-content: flex-start;
    min-height: 40px;
    font-size: 12px;
  }

  .schedule-priority {
    padding: 8px 11px;
    font-size: 10.5px;
    line-height: 1.4;
  }
  .takvim-donem {
    margin-bottom: 4px;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    box-shadow: none;
  }
  .temporary-summary { font-size: 11px; }

  .mobile-week-list,
  .mobile-day-list {
    display: grid;
    gap: 11px;
  }
  .mobile-day-card {
    overflow: hidden;
    border: 1px solid var(--stroke-soft);
    border-radius: 16px;
    background: var(--surface-lowest);
    box-shadow: 0 2px 10px rgba(23, 35, 49, .045);
  }
  .mobile-day-card.today {
    border-color: rgba(3, 155, 229, .38);
    box-shadow: inset 5px 0 var(--primary), 0 3px 14px rgba(3, 104, 153, .09);
  }
  .mobile-day-card.policy-pazar,
  .mobile-day-card.policy-onay-gerekli { background: #fafbfc; }
  .mobile-day-head {
    display: grid;
    grid-template-columns: 52px 1fr auto;
    align-items: center;
    gap: 9px;
    min-height: 68px;
    padding: 10px 14px;
    cursor: pointer;
  }
  .mobile-day-number {
    color: var(--primary);
    font-size: 35px;
    font-weight: 760;
    line-height: 1;
    text-align: center;
  }
  .mobile-day-name b,
  .mobile-day-name small { display: block; }
  .mobile-day-name b { font-size: 15px; }
  .mobile-day-name small {
    margin-top: 2px;
    color: var(--outline);
    font-size: 11px;
  }
  .mobile-day-count {
    color: var(--outline);
    font-size: 10.5px;
    font-weight: 700;
  }
  .mobile-day-policy-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 0 14px 6px;
  }
  .mobile-policy {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 7px;
    border: 0;
    border-radius: 999px;
    font: 700 9px var(--font-sans);
  }
  button.mobile-policy { cursor: pointer; }
  .mobile-policy.preferred { background: #eaf8f2; color: #176a50; }
  .mobile-policy.approved { background: #fff3d2; color: #765100; }
  .mobile-policy.permission { background: #fff3d2; color: #765100; }
  .mobile-policy.closed { background: #eceff2; color: #59616a; }
  .mobile-policy.closure { background: #e5e8eb; color: #3f4852; }
  .mobile-day-appointments {
    display: grid;
    gap: 7px;
    padding: 0 10px 10px;
  }
  .mobile-appointment {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto 14px;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 60px;
    padding: 8px 9px;
    border: 0;
    border-left: 4px solid var(--c-diger);
    border-radius: 10px;
    background: #eef2f6;
    color: var(--on-surface);
    cursor: pointer;
    text-align: left;
  }
  .mobile-appointment.usg { border-left-color: var(--c-usg); background: #eaf1ff; }
  .mobile-appointment.varis { border-left-color: var(--c-varis); background: #fff0ef; }
  .mobile-appointment.biyopsi { border-left-color: var(--c-biyopsi); background: #f4edff; }
  .mobile-appointment.mezo { border-left-color: var(--c-mezo); background: #fff6df; }
  .mobile-appointment.muayene { border-left-color: var(--c-muayene); background: #e8f7fa; }
  .mobile-appointment.gecici { outline: 1px dashed #d39200; outline-offset: -2px; }
  .mobile-appointment.iptal { opacity: .5; text-decoration: line-through; }
  .mobile-appointment-time {
    color: var(--primary);
    font: 750 15px var(--font-mono);
  }
  .mobile-appointment-main,
  .mobile-appointment-main b,
  .mobile-appointment-main small,
  .mobile-appointment-meta small { display: block; min-width: 0; }
  .mobile-appointment-main b,
  .mobile-appointment-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-appointment-main b { font-size: 12px; }
  .mobile-appointment-main small,
  .mobile-appointment-meta small {
    margin-top: 2px;
    color: var(--outline);
    font-size: 9px;
  }
  .mobile-appointment-meta {
    color: var(--outline);
    font-size: 9.5px;
    text-align: right;
  }
  .mobile-appointment-arrow { color: var(--outline); font-size: 23px; }
  .mobile-day-empty {
    padding: 11px 8px;
    color: var(--outline);
    font-size: 11px;
  }
  .mobile-quick-add {
    width: 100%;
    min-height: 40px;
    border: 0;
    border-top: 1px solid var(--stroke-soft);
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    font-size: 11px;
    font-weight: 750;
  }

  .mobile-month {
    overflow: hidden;
    border: 1px solid var(--stroke-soft);
    border-radius: 16px;
    background: var(--surface-lowest);
    box-shadow: 0 3px 14px rgba(23, 35, 49, .05);
  }
  .mobile-month-weekdays,
  .mobile-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
  .mobile-month-weekdays span {
    padding: 10px 1px;
    color: var(--outline);
    font-size: 9px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
  }
  .mobile-month-weekdays span:nth-child(n+6) { color: #c96e72; }
  .mobile-month-day {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    min-height: 82px;
    padding: 6px 4px;
    border: 0;
    border-top: 1px solid var(--stroke-soft);
    border-right: 1px solid var(--stroke-soft);
    background: #fff;
    color: var(--on-surface);
    cursor: pointer;
    text-align: left;
  }
  .mobile-month-day:nth-child(7n) { border-right: 0; }
  .mobile-month-day.outside { opacity: .32; }
  .mobile-month-day.policy-pazar,
  .mobile-month-day.policy-onay-gerekli { background: #fafbfc; }
  .mobile-month-day.today { box-shadow: inset 0 0 0 2px var(--primary); }
  .mobile-month-number {
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
  }
  .mobile-month-day:nth-child(7n) .mobile-month-number { color: #c96e72; }
  .mobile-month-lock {
    position: absolute;
    top: 5px;
    right: 3px;
    font-size: 8px;
  }
  .mobile-month-event {
    overflow: hidden;
    display: block;
    width: 100%;
    padding: 3px 4px;
    border-radius: 5px;
    background: #eaf1ff;
    color: #17447d;
    font-size: 7.5px;
    line-height: 1.1;
  }
  .mobile-month-event.varis { background: #fff0ef; color: #8b3935; }
  .mobile-month-event.biyopsi { background: #f4edff; color: #63408d; }
  .mobile-month-event.mezo { background: #fff6df; color: #765b13; }
  .mobile-month-event.muayene { background: #e8f7fa; color: #21636d; }
  .mobile-month-event b,
  .mobile-month-event small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-month-event small { display: none; }
  .mobile-month-more {
    color: var(--primary);
    font-size: 8.5px;
    font-weight: 800;
  }

  .appointment-mode { grid-template-columns: 1fr; }
  .appointment-mode span { min-height: 54px; }
  .appointment-settings-head { display: none; }
  .appointment-setting-row {
    grid-template-columns: 1fr 80px 40px;
    padding: 10px 0;
  }
  .appointment-setting-row .konu-ad { grid-column: 1 / 4; }
  .appointment-setting-row .konu-grup { grid-column: 1 / 2; }
  .appointment-setting-row > label > span { display: inline; }
  .appointment-setting-row .setting-active { grid-column: 2 / 3; }
  .appointment-setting-row .konu-sil { grid-column: 3 / 4; }
  .birthday-row {
    grid-template-columns: 38px 1fr;
  }
  .birthday-row .birthday-send,
  .birthday-row .birthday-open {
    grid-column: 2 / 3;
    width: 100%;
  }
}

/* ---- Randevu üst alanı v47: takvim için daha fazla çalışma alanı ---- */
.calendar-notice-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(240px, auto);
  gap: 8px;
  align-items: stretch;
  margin: 0 0 8px;
}
.calendar-notice-row .schedule-priority,
.calendar-notice-row .temporary-summary {
  display: flex;
  align-items: center;
  min-height: 34px;
  margin: 0;
  padding: 7px 10px;
  line-height: 1.25;
}
.calendar-notice-row .schedule-priority { display: block; }

@media (min-width: 641px) {
  .appointment-head {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
  }
  .appointment-head .grow {
    order: 0;
    flex: 1 1 150px;
    min-width: 105px;
  }
  .appointment-head .grow h1 {
    margin: 0;
    font-size: 21px;
    line-height: 1.1;
  }
  .appointment-head .view-switch {
    order: 1;
    display: inline-grid;
    grid-template-columns: repeat(3, minmax(64px, 1fr));
    flex: 0 1 225px;
    min-width: 195px;
    padding: 2px;
    border-radius: 11px;
  }
  .appointment-head .view-switch .btn,
  .appointment-head .calendar-nav .btn,
  .appointment-head #btn-arac,
  .appointment-head #btn-rnd-yeni {
    min-height: 34px;
    padding-block: 5px;
    font-size: 11.5px;
  }
  .appointment-head .view-switch .btn { border-radius: 9px; }
  .appointment-head .calendar-nav { order: 2; flex: 0 0 auto; padding: 2px; }
  .appointment-head .calendar-nav .btn-icon { width: 32px; padding-inline: 0; }
  .appointment-head .rnd-arac-sar {
    order: 3;
    position: relative;
    display: block;
    flex: 0 0 auto;
  }
  .appointment-head #btn-arac { display: inline-flex; white-space: nowrap; }
  .appointment-head .rnd-araclar {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 70;
    display: none;
    flex-direction: column;
    gap: 6px;
    min-width: 205px;
    padding: 9px;
    border: 1px solid var(--stroke-soft);
    border-radius: 12px;
    background: var(--surface-lowest);
    box-shadow: 0 12px 28px rgba(23, 35, 49, .17);
  }
  .appointment-head .rnd-araclar.acik { display: flex; }
  .appointment-head .rnd-araclar .btn,
  .appointment-head #btn-hatirlatma-sirasi {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    min-height: 36px;
    font-size: 11.5px;
  }
  .appointment-head #btn-rnd-yeni { order: 4; flex: 0 0 auto; white-space: nowrap; }

  .calendar-find-bar {
    grid-template-columns: minmax(145px, 180px) minmax(320px, 1fr);
    gap: 8px;
    margin-bottom: 8px;
    padding: 7px 9px;
    border-radius: 10px;
  }
  .calendar-find-bar input {
    min-height: 34px;
    margin-top: 3px;
    padding: 6px 9px;
  }
  .calendar-patient-search-input .btn { min-height: 34px; }
}

@media (min-width: 641px) and (max-width: 900px) {
  .appointment-head .grow { flex-basis: 105px; }
  .appointment-head .view-switch { min-width: 180px; }
  .appointment-head #btn-rnd-yeni {
    width: 36px;
    padding-inline: 0;
  }
  .appointment-head #btn-rnd-yeni span { display: none; }
  .calendar-find-bar {
    grid-template-columns: minmax(135px, 165px) minmax(0, 1fr);
  }
}

@media (max-width: 740px) {
  .calendar-notice-row { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .calendar-notice-row { margin-bottom: 0; }
  .calendar-notice-row .temporary-summary,
  .calendar-notice-row .schedule-priority { display: none; }
}

@media (min-width: 420px) and (max-width: 640px) {
  .mobile-month-day { min-height: 96px; padding: 7px 5px; }
  .mobile-month-event { font-size: 8px; }
  .mobile-month-event small { display: block; margin-top: 1px; }
}

@media (min-width: 641px) and (max-width: 900px) {
  .mobile-week-list { grid-template-columns: 1fr; }
}

/* ---- Hasta dışı görüşmeler ----
   Ajans, tedarikçi, özel görüşme gibi hasta olmayan takvim kayıtları.
   Kesikli kenarlık ve nötr renkle hasta randevularından ayrılır. */
.outlook-event.harici,
.mobile-appointment.harici {
  background: repeating-linear-gradient(135deg,
    rgba(100, 116, 139, .13) 0 8px, rgba(100, 116, 139, .07) 8px 16px);
  border-left-color: #64748b;
  color: var(--on-surface);
}
.outlook-event.harici b::before,
.mobile-appointment.harici b::before { content: "◇ "; opacity: .7; }
.temporary-detail.harici { border-color: #94a3b8; background: var(--surface-container); }

/* Bakılan dönemin iki yanında görünümle birlikte adı değişen gezinme okları.
   Takvim kaydırılsa da erişilebilir kalır; dönem değişimi sayfayı yenilemez. */
.calendar-period-nav {
  position: sticky;
  top: 0;
  z-index: 24;
  display: grid;
  grid-template-columns: minmax(120px, auto) minmax(0, 1fr) minmax(120px, auto);
  gap: 7px;
  align-items: stretch;
  margin: 0 0 6px;
  padding: 4px;
  border: 1px solid var(--stroke-soft);
  border-radius: var(--r-md);
  background: var(--surface-lowest);
  box-shadow: var(--shadow-1);
}
.calendar-period-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 48px;
  padding: 7px 12px;
  border: 1px solid rgba(3, 155, 229, .22);
  border-radius: 10px;
  color: var(--primary);
  background: rgba(3, 155, 229, .07);
  font: 700 12px var(--font-sans);
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease, transform .14s ease;
}
.calendar-period-button:hover,
.calendar-period-button:focus-visible {
  border-color: rgba(3, 155, 229, .48);
  background: rgba(3, 155, 229, .13);
  outline: none;
}
.calendar-period-button:active { transform: scale(.98); }
.calendar-period-arrow {
  display: inline-flex;
  flex: 0 0 auto;
}
.calendar-period-arrow svg { width: 18px; height: 18px; }
.calendar-period-button.onceki .calendar-period-arrow { transform: rotate(180deg); }
.calendar-period-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 4px 8px;
}
.calendar-period-center #btn-bugun {
  min-height: 22px;
  margin-top: 1px;
  padding: 2px 8px;
  color: var(--outline);
  font-size: 9.5px;
}
.takvim-donem {
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  color: var(--on-primary-container);
  line-height: 1.2;
}

/* Dönem geçişi: takvim gövdesi sayfa yenilenmeden değişir.
   --kay kaydırma yönünü verir (ileri +, geri −). */
#takvim-kutu { will-change: transform, opacity; }
.takvim-gecis { animation: takvimKay .18s ease-out; }
@keyframes takvimKay {
  from { opacity: .35; transform: translateX(var(--kay, 0px)); }
  to   { opacity: 1;   transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .takvim-gecis { animation: none; }
}

/* Pazar günü klinik kapalı — takvimde sütun olarak yer kaplamaz (6 sütun). */
.cal-ay, .cal-ay-baslik,
.mobile-month-weekdays, .mobile-month-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
}

@media (max-width: 640px) {
  /* Sayfa başlığı geri geldi, ama ince: takvimden yer çalmaz */
  .appointment-head .grow { display: block; grid-column: 1 / 3; }
  .appointment-head .grow h1 {
    margin: 0 0 2px;
    font-size: 20px;
    line-height: 1.15;
    letter-spacing: -.01em;
  }
  /* Bilgi notları telefonda gizli; masaüstünde görünmeye devam eder */
  .temporary-summary, .schedule-priority { display: none; }
  .calendar-period-nav {
    grid-template-columns: minmax(88px, 1fr) minmax(104px, 1.15fr) minmax(88px, 1fr);
    gap: 4px;
    padding: 3px;
    border-radius: 10px;
  }
  .calendar-period-button {
    gap: 3px;
    min-height: 43px;
    padding: 5px 6px;
    border-radius: 8px;
    font-size: 9.5px;
    line-height: 1.15;
    white-space: nowrap;
  }
  .calendar-period-arrow svg { width: 15px; height: 15px; }
  .calendar-period-center { padding: 3px 4px; }
  .calendar-period-center #btn-bugun {
    min-height: 18px;
    padding: 1px 3px;
    font-size: 8px;
  }
  .calendar-period-center .takvim-donem {
    font-size: 12.5px;
    font-weight: 600;
  }
}
