/* ============================================================
   Component: modal
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background: rgba(26, 24, 54, .5);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
  opacity: 0; visibility: hidden; transition: opacity var(--transition);
}
.modal-backdrop.is-open { opacity: 1; visibility: visible; }

.modal {
  background: var(--surface);
  width: 100%; max-width: 560px; max-height: 92vh;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-xl);
  display: flex; flex-direction: column;
  transform: translateY(20px); transition: transform var(--transition);
}
.modal-backdrop.is-open .modal { transform: none; }

.modal-head {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border);
}
.modal-title { font-size: var(--fs-md); font-weight: 700; flex: 1; }
.modal-close { color: var(--text-muted); font-size: 24px; line-height: 1; width: 32px; height: 32px; border-radius: var(--radius-sm); }
.modal-close:hover { background: var(--bg); color: var(--text); }

.modal-body { padding: var(--space-5); overflow-y: auto; }
.modal-foot {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2);
  padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border);
}
/* Footer içeriği sarmalayıcı <div> ile gelir; şeffaflaştır ki butonlar
   doğrudan .modal-foot'un flex öğeleri olsun (gap + sağa hizalama uygulansın). */
.modal-foot > div { display: contents; }

@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: var(--space-5); }
  .modal { border-radius: var(--radius-lg); }
}

/* Geniş modal (ör. satış/alış iadesi: çok sütunlu kalem tablosu + geri ödeme).
   width:100% korunduğundan mobilde yine viewport'a sığar; yalnız üst sınır artar. */
.modal.modal--wide { max-width: 860px; }

/* — Baskı şablonu seçici modalı (Satış/Alış "Yazdır") — */
.pp-wrap { display: flex; flex-direction: column; gap: var(--space-3); }
.pp-lbl { font-size: var(--text-xs); font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.pp-list { display: flex; flex-direction: column; gap: var(--space-2); }
.pp-tpl { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); width: 100%; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: 10px 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.pp-tpl:hover { border-color: var(--brand); }
.pp-tpl.is-active { border-color: var(--brand); background: var(--brand-tint); box-shadow: 0 0 0 1px var(--brand) inset; }
.pp-tpl-name { font-weight: 600; color: var(--text); }
.pp-tpl-def { font-size: var(--text-xs); font-weight: 700; color: var(--brand); }
.pp-tpl-meta { font-size: var(--text-xs); color: var(--text-muted); font-weight: 700; white-space: nowrap; }
.pp-def-row { display: flex; align-items: center; gap: 8px; font-size: var(--text-sm); color: var(--text-muted); cursor: pointer; }
