/* Shared modal primitives for manager and secretary screens. */

.notet-drawer-modal {
  --notet-drawer-width: min(42vw, 760px);
  --notet-drawer-tablet-width: min(84vw, 720px);
  --notet-drawer-mobile-height: min(78dvh, calc(100dvh - env(safe-area-inset-top) - 12px));
  --notet-drawer-accent: #1a73e8;
  --notet-drawer-x: clamp(2rem, 3.4vw, 3rem);
  --notet-drawer-header-y: clamp(.85rem, 1.6dvh, 1.25rem);
  --notet-drawer-body-y: clamp(.85rem, 1.75dvh, 1.25rem);
  --notet-drawer-footer-y: clamp(.65rem, 1.35dvh, .95rem);
  --notet-drawer-footer-x: clamp(1.45rem, 2.7vw, 2.25rem);
  --notet-drawer-action-height: clamp(3rem, 4.8dvh, 3.65rem);
  --notet-drawer-icon-size: clamp(3.25rem, 5.4dvh, 4rem);
}

.notet-drawer-modal--compact {
  --notet-drawer-width: min(36vw, 620px);
}

.notet-drawer-modal--narrow {
  --notet-drawer-width: min(380px, 92vw);
  --notet-drawer-tablet-width: min(380px, 92vw);
}

.notet-drawer-modal--frame .modal-body {
  padding: 0;
  overflow: hidden;
}

.notet-drawer-modal__frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #fff;
}

.notet-drawer-modal__frame-loading {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: #5f6673;
  font-weight: 650;
  background: #fff;
  z-index: 2;
}

.notet-drawer-modal__frame-loading.is-active {
  display: flex;
}

html.notet-patient-detail-drawer-host,
body.notet-patient-detail-drawer-host {
  width: 100%;
  height: 100%;
  margin: 0 !important;
  overflow: hidden !important;
  background: #fff;
}

body.notet-patient-detail-drawer-host .patient-detail-page > .patient-panel,
body.notet-patient-detail-drawer-host .modal-backdrop {
  display: none !important;
}

body.notet-patient-detail-drawer-host .notet-drawer-modal {
  --notet-drawer-width: 100vw;
  --notet-drawer-tablet-width: 100vw;
  /* Host iframe'inde çekmece zaten dar; iç boşlukları azaltıp formu genişlet */
  --notet-drawer-x: clamp(1.1rem, 2.4vw, 1.6rem);
  --notet-drawer-footer-x: clamp(1rem, 2.2vw, 1.4rem);
}

body.notet-patient-detail-drawer-host .modal.notet-drawer-modal {
  padding: 0 !important;
  overflow: hidden !important;
}

body.notet-patient-detail-drawer-host .modal.notet-drawer-modal .modal-dialog {
  top: 0 !important;
  right: 0 !important;
  bottom: auto !important;
  left: auto !important;
  width: 100vw !important;
  height: 100dvh !important;
  margin: 0 !important;
}

html.notet-drawer-modal-open,
body.notet-drawer-modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}

body.notet-drawer-modal-open .main-content-wrapper,
body.notet-drawer-modal-open .main-content-wrapper > main,
body.notet-drawer-modal-open #sidebar,
body.notet-drawer-modal-open #sidebar > ul.nav {
  overflow: hidden !important;
}

.modal.notet-drawer-modal .modal-dialog {
  --bs-modal-width: var(--notet-drawer-width);
  position: fixed;
  top: 0;
  right: 0;
  width: var(--bs-modal-width);
  max-width: 100vw;
  height: 100dvh;
  margin: 0 0 0 auto;
  transform: none !important;
  transition: none !important;
}

.modal.notet-drawer-modal.fade .modal-dialog {
  transform: none !important;
}

.modal.notet-drawer-modal.show .modal-dialog {
  transform: none !important;
}

.modal.notet-drawer-modal.fade.show .modal-dialog {
  transform: none !important;
}

.modal.notet-drawer-modal.fade {
  transition: none !important;
}

.notet-drawer-modal .modal-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: -22px 0 48px rgba(15, 23, 42, .18);
  background: #fff;
}

.notet-drawer-modal__header {
  display: block;
  padding: var(--notet-drawer-header-y) var(--notet-drawer-x) calc(var(--notet-drawer-header-y) * .72);
  border-bottom: 0;
  background: #fff;
}

.notet-drawer-modal__title-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.notet-drawer-modal__icon {
  width: var(--notet-drawer-icon-size);
  height: var(--notet-drawer-icon-size);
  flex: 0 0 auto;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--notet-drawer-accent);
  background:
    linear-gradient(135deg, rgba(26, 115, 232, .18), rgba(26, 115, 232, .08));
}

.notet-drawer-modal__icon svg {
  width: 2.1rem;
  height: 2.1rem;
}

.notet-drawer-modal__icon i {
  font-size: 1.75rem !important;
  line-height: 1;
}

.notet-drawer-modal__title {
  margin: 0;
  color: #111827;
  font-size: 1.25rem;
  font-weight: 760;
  line-height: 1.2;
}

.notet-drawer-modal__subtitle {
  margin-top: .3rem;
  color: #5f6673;
  font-size: .9rem;
  line-height: 1.4;
}

.notet-drawer-modal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: var(--notet-drawer-body-y) var(--notet-drawer-x) calc(var(--notet-drawer-body-y) * 1.25);
  background: #fff;
}

.notet-drawer-modal .form-control::placeholder,
.notet-drawer-modal .form-control::-webkit-input-placeholder {
  color: rgba(148, 163, 184, .85);
  font-style: italic;
}

.notet-drawer-modal .label-with-help {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.notet-drawer-modal .field-help-tip {
  appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #c9d3df;
  border-radius: 999px;
  background: #f8fafc;
  color: #64748b;
  font: inherit;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
}

.notet-drawer-modal .field-help-tip:hover,
.notet-drawer-modal .field-help-tip:focus {
  border-color: #94a3b8;
  background: #eef2f7;
  color: #334155;
  outline: none;
}

.notet-drawer-modal .readonly-field {
  background-color: #e9ecef;
}

.notet-drawer-modal .js-modal-submit-btn,
.notet-drawer-modal .js-product-submit-btn {
  transition: transform .12s ease, box-shadow .12s ease;
}

.notet-drawer-modal .js-modal-submit-btn .btn-spinner {
  display: none;
}

.notet-drawer-modal .js-modal-submit-btn[aria-busy="true"],
.notet-drawer-modal .js-product-submit-btn[aria-busy="true"] {
  transform: translateY(2px) scale(.99);
  box-shadow: none !important;
}

.notet-drawer-modal .js-modal-submit-btn[aria-busy="true"] .btn-spinner {
  display: inline-block;
}

.notet-drawer-modal .js-modal-submit-btn[aria-busy="true"] .btn-label,
.notet-drawer-modal .js-product-submit-btn[aria-busy="true"] .btn-label {
  opacity: .96;
}

.notet-drawer-modal .modal-footer {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
  padding: var(--notet-drawer-footer-y) var(--notet-drawer-footer-x) calc(var(--notet-drawer-footer-y) + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(229, 231, 235, .72);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 -12px 28px rgba(15, 23, 42, .10);
}

.notet-drawer-modal .modal-footer .btn {
  width: 100%;
  min-height: var(--notet-drawer-action-height);
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.08rem;
  font-weight: 750;
  line-height: 1.1;
}

.notet-drawer-modal .modal-footer .btn-secondary,
.notet-drawer-modal .modal-footer .btn-outline-secondary {
  border-color: #d4d8df;
  background: #fff;
  color: #3f4652;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

.notet-drawer-modal .modal-footer .btn-primary {
  border-color: var(--notet-drawer-accent);
  background: var(--notet-drawer-accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(26, 115, 232, .24);
}

.notet-drawer-modal .btn-close {
  display: none;
}

.notet-drawer-modal__form {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.modal.notet-drawer-modal .modal-content > .notet-drawer-modal__form {
  height: auto;
  flex: 1 1 auto;
}

.modal.notet-drawer-modal .modal-dialog > .notet-drawer-modal__form {
  height: 100%;
}

.notet-drawer-modal__form .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

@media (max-width: 991.98px) {
  .modal.notet-drawer-modal .modal-dialog {
    --bs-modal-width: var(--notet-drawer-tablet-width);
  }

  .notet-drawer-modal__header {
    padding: .9rem 1.25rem .8rem;
  }

  .notet-drawer-modal__title-wrap {
    gap: .85rem;
  }

  .notet-drawer-modal__icon {
    width: 3.25rem;
    height: 3.25rem;
  }

  .notet-drawer-modal__icon svg {
    width: 1.9rem;
    height: 1.9rem;
  }

  .notet-drawer-modal__icon i {
    font-size: 1.6rem !important;
  }

  .notet-drawer-modal__title {
    font-size: 1.15rem;
  }

  .notet-drawer-modal__subtitle {
    margin-top: .25rem;
    font-size: .84rem;
    line-height: 1.35;
  }
}

/* Danışan profili randevu iptal çekmecesi */
.notet-cancel-drawer {
  --notet-drawer-accent: #dc3545;
}

.notet-cancel-drawer .notet-drawer-modal__icon {
  color: #dc3545;
  background: #fff1f2;
}

.notet-cancel-drawer .modal-body {
  background: #f8fafc;
}

.notet-cancel-card {
  padding: 1.15rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
}

.notet-cancel-card h6 {
  margin: 0 0 .85rem;
  color: #1e293b;
  font-size: 1rem;
  font-weight: 750;
}

.notet-cancel-summary {
  display: grid;
  gap: .38rem;
  color: #334155;
}

.notet-cancel-summary__line {
  display: flex;
  gap: .4rem;
  line-height: 1.4;
}

.notet-cancel-summary__line strong {
  flex: 0 0 5.1rem;
  color: #1e293b;
}

.notet-cancel-preview {
  max-height: 14rem;
  margin-top: .85rem;
  padding: .85rem;
  overflow-y: auto;
  border-radius: .75rem;
  background: #f1f5f9;
  color: #475569;
  font-size: .9rem;
  line-height: 1.55;
}

.notet-cancel-preview strong {
  display: block;
  margin-bottom: .35rem;
  color: #1e293b;
}

.notet-cancel-preview__error {
  color: #b42318;
  font-weight: 650;
}

.notet-cancel-preview__retry {
  margin-top: .65rem;
  padding: .45rem .75rem;
  border: 1px solid #fecaca;
  border-radius: .55rem;
  background: #fff;
  color: #b42318;
  font-weight: 700;
}

.notet-cancel-preview__retry:hover,
.notet-cancel-preview__retry:focus-visible {
  border-color: #ef4444;
  background: #fff1f2;
  outline: none;
}

.notet-cancel-notify-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.notet-cancel-notify-option {
  position: relative;
  min-height: 6.7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  border: 1px solid #dbe2ea;
  border-radius: .85rem;
  background: #fff;
  color: #172033;
  font-weight: 700;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.notet-cancel-notify-option:hover {
  border-color: #94a3b8;
}

.notet-cancel-notify-option.selected {
  border-color: #28a745;
  background: #28a745;
  color: #fff;
  box-shadow: none;
}

.notet-cancel-notify-option.disabled,
.notet-cancel-notify-option[data-gate-disabled="1"] {
  cursor: not-allowed;
  opacity: .55;
}

.notet-cancel-notify-icon {
  font-size: 2rem;
  line-height: 1;
}

.notet-cancel-status-dot {
  position: absolute;
  top: .65rem;
  right: .65rem;
  width: .65rem;
  height: .65rem;
  border-radius: 50%;
  background: #94a3b8;
}

.notet-cancel-status-dot.online {
  background: #22c55e;
}

.notet-cancel-status-dot.offline {
  background: #ef4444;
}

.notet-cancel-drawer .modal-footer .btn-danger {
  border-color: #dc3545;
  background: #dc3545;
  color: #fff;
  box-shadow: 0 8px 18px rgba(220, 53, 69, .2);
}

.notet-cancel-drawer .modal-footer .btn-danger:disabled {
  box-shadow: none;
}

@media (max-width: 576px) {
  .modal.notet-drawer-modal .modal-dialog {
    --bs-modal-width: 100vw;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    max-width: 100vw;
    height: var(--notet-drawer-mobile-height);
    margin-bottom: 0 !important;
    transform: none !important;
  }

  .modal.notet-drawer-modal.fade .modal-dialog {
    transform: none !important;
  }

  .modal.notet-drawer-modal.show .modal-dialog {
    transform: none !important;
  }

  .modal.notet-drawer-modal.fade.show .modal-dialog {
    transform: none !important;
  }

  .notet-drawer-modal .modal-content {
    border-radius: 0;
  }

  .notet-drawer-modal__header {
    padding: .8rem .9rem;
  }

  .notet-drawer-modal__title-wrap {
    gap: .8rem;
  }

  .notet-drawer-modal__icon {
    width: 3rem;
    height: 3rem;
  }

  .notet-drawer-modal__icon svg {
    width: 1.75rem;
    height: 1.75rem;
  }

  .notet-drawer-modal__icon i {
    font-size: 1.45rem !important;
  }

  .notet-drawer-modal__title {
    font-size: 1.05rem;
  }

  .notet-drawer-modal__subtitle {
    margin-top: .18rem;
    font-size: .78rem;
    line-height: 1.3;
  }

  .notet-drawer-modal .modal-body {
    padding: .85rem;
  }

  .notet-drawer-modal .modal-footer {
    gap: .75rem;
    padding: .85rem .85rem calc(.85rem + env(safe-area-inset-bottom));
  }

  .notet-drawer-modal .modal-footer .btn {
    min-height: 3.55rem;
    font-size: .98rem;
  }
}

/*
 * Framework bağımsız uyarlanabilir panel.
 * Masaüstünde sağ drawer, mobilde bottom sheet olarak çalışır.
 */
.notet-sheet {
  --notet-sheet-width: clamp(420px, 36vw, 620px);
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  justify-content: flex-end;
  visibility: hidden;
  background: rgba(15, 23, 42, .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, visibility 0s linear .2s;
}

.notet-sheet.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0s;
}

html.notet-sheet-open,
body.notet-sheet-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.notet-sheet__panel {
  width: var(--notet-sheet-width);
  max-width: 100vw;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-left: 1px solid #e5e7eb;
  border-radius: 16px 0 0 16px;
  box-shadow: -18px 0 42px rgba(15, 23, 42, .22);
  transform: translateX(100%);
  transition: transform .24s ease;
}

.notet-sheet.is-open .notet-sheet__panel {
  transform: translateX(0);
}

.notet-sheet__header {
  flex: 0 0 auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.notet-sheet__title {
  margin: 0;
  color: #111827;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.25;
}

.notet-sheet__close {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: #374151;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.notet-sheet__close:hover,
.notet-sheet__close:focus-visible {
  background: #f3f4f6;
  outline: none;
}

.notet-sheet__body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
}

.notet-sheet__footer {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .97);
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -8px 20px rgba(15, 23, 42, .07);
}

.notet-sheet__footer .btn {
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 767.98px) {
  .notet-sheet {
    align-items: flex-end;
    justify-content: center;
  }

  .notet-sheet__panel {
    width: 100vw;
    height: auto;
    max-height: min(78dvh, calc(100dvh - env(safe-area-inset-top) - 12px));
    border: 0;
    border-top: 1px solid #e5e7eb;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -18px 42px rgba(15, 23, 42, .22);
    transform: translateY(100%);
  }

  .notet-sheet__header {
    min-height: 58px;
    padding: 11px 14px;
  }

  .notet-sheet__body {
    padding: 16px 14px;
  }

  .notet-sheet__footer {
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .notet-sheet,
  .notet-sheet__panel {
    transition: none;
  }
}
