/* Tahsilat — hasta kartı "Hesap" (gorunum/tahsilat-kart.js), menü ekranı (tahsilat.js), kipler ve makbuz (tahsilat-ortak.js).
   Belirteçler css/belirtec.css'ten (Gündüz; kurum rengi --vurgu); sabit renk yalnız baskıda (siyah beyaz makbuz).
   Telefon (375 px): yatay taşma yok; özet tek sütuna iner, taksit satırları vade ve tutarı alt alta dizer, tablolar kart listesine döner
   (bileşen kuralı). Baskı yalnız .tah-baski'yi basar (A5 makbuz). */

/* ---------- hasta kartı: geniş bölüm ---------- */
.hs-ekler > .hs-ek-tahsilat { grid-column: 1 / -1; }
.tah-hesap { min-width: 0; }
.tah-ozet { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); gap: 12px; align-items: stretch; min-width: 0; }
@media (max-width: 640px) { .tah-ozet { grid-template-columns: minmax(0, 1fr); } }
.tah-bakiye {
  display: flex; flex-direction: column; gap: 2px; justify-content: center; min-width: 0; padding: 12px 14px;
  border: 1px solid var(--cizgi); border-left: 4px solid var(--vurgu); border-radius: var(--r); background: var(--yuzey);
}
.tah-bakiye[data-ton="uyari"] { border-left-color: var(--uyari); }
.tah-bakiye[data-ton="basari"] { border-left-color: var(--iyi); }
.tah-bakiye-ad { font-size: .8125rem; color: var(--metin2); }
.tah-bakiye-n { font-family: var(--f-sayi); font-size: 1.6rem; font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; }
.tah-bakiye[data-ton="uyari"] .tah-bakiye-n { color: var(--uyari); }
.tah-bakiye[data-ton="vurgu"] .tah-bakiye-n { color: var(--vurgu); }
.tah-bakiye[data-ton="basari"] .tah-bakiye-n { color: var(--iyi); }
.tah-bakiye-alt { font-size: .8125rem; color: var(--uyari); font-weight: 600; }
.tah-sayaclar { grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); }
.tah-sayaclar .bg-sayac-n { font-size: 1.15rem; overflow-wrap: anywhere; }
.tah-eylemler { gap: 8px; }
.tah-kalem { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.tah-alt { display: block; font-size: .75rem; line-height: 1.35; overflow-wrap: anywhere; }
.tah-tutar { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tah-tutar[data-yon="azalir"], .tah-tutar[data-yon="giris"] { color: var(--iyi); }
.tah-tutar[data-yon="cikis"] { color: var(--uyari); }
tr[data-ters] .tah-tutar { color: var(--metin3); text-decoration: line-through; }
tr[data-ters] td { color: var(--metin2); }
.tah-hasta { display: inline-flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.tah-yasli { color: var(--uyari); font-weight: 600; }

/* ---------- taksit planı ve kaporalar (kartta) ---------- */
.tah-plan { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 10px 12px; border: 1px solid var(--cizgi); border-radius: var(--r); background: var(--yuzey2); }
.tah-plan-baslik { margin: 0; font-size: .875rem; overflow-wrap: anywhere; }
.tah-gecmis { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: .8125rem; overflow-wrap: anywhere; }
.tah-kapora { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 10px 12px; border: 1px solid var(--cizgi); border-left: 4px solid var(--cizgi2); border-radius: var(--r); background: var(--yuzey); }
.tah-kapora[data-durum="iade_bekliyor"] { border-left-color: var(--uyari); }
.tah-kapora[data-durum="sayildi"] { border-left-color: var(--iyi); }
.tah-kapora[data-durum="bekliyor"] { border-left-color: var(--vurgu); }
.tah-kapora-bas { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; min-width: 0; }
.tah-kapora-bas p { margin: 0; overflow-wrap: anywhere; }

/* ---------- kipler ---------- */
.tah-tutar-girdi { font-variant-numeric: tabular-nums; }
.tah-teklif-tutar { margin: 0; padding: 8px 10px; border-radius: var(--r-k); background: var(--vurgu-zemin); color: var(--metin); font-size: .875rem; overflow-wrap: anywhere; }
.tah-taksit-ayar { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 10px 12px; }
.tah-taksit-kap { min-width: 0; }
.tah-taksit-satirlar { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.tah-taksit-satir { display: grid; grid-template-columns: 2.2em minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; min-width: 0; }
.tah-taksit-satir .girdi { min-width: 0; width: 100%; }
.tah-taksit-no { color: var(--metin2); font-size: .8125rem; text-align: right; }
@media (max-width: 420px) {
  .tah-taksit-satir { grid-template-columns: 2em minmax(0, 1fr); }
  .tah-taksit-satir .tah-tutar-girdi { grid-column: 2; }
}
.tah-taksit-toplam { margin: 0; padding: 6px 10px; border-radius: var(--r-k); font-size: .875rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tah-taksit-toplam[data-ton="basari"] { background: var(--iyi-zemin); color: var(--iyi); }
.tah-taksit-toplam[data-ton="uyari"] { background: var(--uyari-zemin); color: var(--uyari); }

/* ---------- menü ekranı ---------- */
.tah-arac { gap: 8px 12px; flex-wrap: wrap; }
.tah-arac .bolumlu { max-width: 100%; overflow-x: auto; }
.tah-gun { gap: 6px 8px; }
.tah-gun .girdi { width: auto; min-width: 0; max-width: 100%; }
.tah-govde { min-width: 0; }
.tah-bugun .stk-bugun-liste li[data-ton="bilgi"] { border-left-color: var(--vurgu); }

/* ---------- makbuz (önizleme ve baskı) ---------- */
.tah-onizleme { border: 1px solid var(--cizgi); border-radius: var(--r); background: var(--yuzey); padding: 16px; min-width: 0; overflow-x: auto; }
.tah-makbuz { display: flex; flex-direction: column; gap: 10px; min-width: 0; max-width: 560px; margin: 0 auto; font-size: .875rem; }
.tah-makbuz p { margin: 0; }
.tm-bas { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding-bottom: 8px; border-bottom: 1px solid var(--cizgi2); }
.tm-kurum { display: flex; align-items: center; gap: 10px; min-width: 0; overflow-wrap: anywhere; }
.tm-logo { max-height: 44px; max-width: 150px; width: auto; height: auto; }
.tm-sube { font-size: .75rem; color: var(--metin2); }
.tm-baslik { display: flex; flex-direction: column; gap: 2px; text-align: right; min-width: 0; }
.tm-baslik h1 { margin: 0; font-size: 1.05rem; letter-spacing: .02em; }
.tm-iptal { padding: 6px 8px; border: 2px solid var(--kritik); border-radius: var(--r-k); color: var(--kritik); font-weight: 700; text-align: center; }
.tm-tanim { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; margin: 0; }
.tm-tanim dt { color: var(--metin2); }
.tm-tanim dd { margin: 0; overflow-wrap: anywhere; }
.tm-tutar { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.tm-imza { display: flex; flex-direction: column; align-items: flex-end; gap: 22px; margin-top: 8px; font-size: .75rem; color: var(--metin2); }
.tm-cizgi { display: block; width: 180px; max-width: 60%; border-bottom: 1px solid var(--cizgi2); }
.tm-not { white-space: pre-line; border-top: 1px solid var(--cizgi); padding-top: 6px; overflow-wrap: anywhere; }
.tm-ibare { font-weight: 700; text-align: center; padding-top: 6px; border-top: 1px dashed var(--cizgi2); }
.tm-nusha { text-align: center; font-size: .75rem; font-weight: 600; }
.tm-alt { font-size: .7rem; color: var(--metin3); text-align: center; }

.tah-baski { display: none; }
@page tah-a5 { size: A5; margin: 10mm; }
@media print {
  body.tah-yazdiriliyor > *:not(.tah-baski) { display: none !important; }
  body.tah-yazdiriliyor .tah-baski { display: block; page: tah-a5; color: #000; background: #fff; font: 9.5pt/1.45 "Segoe UI", system-ui, sans-serif; }
  .tah-baski .tah-makbuz { max-width: none; font-size: inherit; gap: 3mm; }
  .tah-baski .tm-bas, .tah-baski .tm-not, .tah-baski .tm-ibare { border-color: #555; }
  .tah-baski .tm-cizgi { border-bottom-color: #000; }
  .tah-baski .tm-tanim dt, .tah-baski .tm-sube, .tah-baski .tm-imza, .tah-baski .tm-alt { color: #333; }
  .tah-baski .tm-iptal { border-color: #000; color: #000; }
}
