/* ==========================================================================
   IYAŞ Giriş Pusulası — A4 dikey belge şablonu
   Ekran önizlemesi ve yazıcı çıktısı aynı stilleri kullanır.
   ========================================================================== */

.sheet {
  --pad-top: 5mm;
  --pad-x: 25mm;
  --header-gap: 8mm;
  --table-gap: 4mm;
  --big-area: 120mm;
  --big-font: 367px;
  --yalniz-font: 12pt;
  --name-font: 24pt;
  --total-font: 36pt;
  --logo-w: 38mm;

  position: relative;
  box-sizing: border-box;
  width: 210mm;
  height: 296.8mm;
  padding: var(--pad-top) var(--pad-x) 8mm var(--pad-x);
  background: #fff;
  color: #000;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-size: 11pt;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* --- Üst blok --------------------------------------------------------- */

.sheet__logo {
  width: var(--logo-w);
  height: auto;
  display: block;
  margin-bottom: 2mm;
}

.sheet__company {
  text-align: center;
  font-family: "Times New Roman", Times, serif;
  font-weight: 700;
  font-size: 14pt;
  letter-spacing: .2px;
  margin: 0 0 5mm 0;
}

.sheet__doctitle {
  text-align: center;
  font-family: "Times New Roman", Times, serif;
  font-weight: 700;
  font-size: 14pt;
  color: #e2001a;
  margin: 0 0 4mm 0;
}

.sheet__docno {
  text-align: right;
  font-family: Arial, sans-serif;
  font-size: 11pt;
  margin: 0;
  white-space: nowrap;
}

.sheet__desc {
  margin: var(--header-gap) 0 0 0;
  font-size: 10.5pt;
  line-height: 1.35;
}

.sheet__section {
  text-align: center;
  font-weight: 700;
  font-size: 11pt;
  margin: 5mm 0 var(--table-gap) 0;
}

/* --- Tablo ------------------------------------------------------------ */

.sheet__table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11pt;
  /* Dış çerçeve + mm cinsinden kenarlıklar: ince piksel çizgileri bazı yazıcılarda kayboluyor. */
  border: 0.25mm solid #000;
}

.sheet__table col.c1 { width: 20.5%; }
.sheet__table col.c2 { width: 12.9%; }
.sheet__table col.c3 { width: 33.2%; }
.sheet__table col.c4 { width: 33.4%; }

.sheet__table th,
.sheet__table td {
  border: 0.25mm solid #000;
  padding: 1.2mm 2mm;
  vertical-align: middle;
}

.sheet__table th {
  text-align: center;
  font-weight: 700;
  height: 7mm;
}

/* Taslakta ORTAK NO / ADI-SOYADI satırı 24pt, TOPLAM hücresi 36pt basılır. */
.sheet__table td.val {
  height: 12mm;
  text-align: center;
  font-weight: 700;
  font-size: var(--name-font);
  line-height: 1.1;
  word-break: break-word;
}

.sheet__table td.val--name {
  letter-spacing: .2px;
}

.sheet__table td.val--total {
  font-size: var(--total-font);
  line-height: 1.05;
}

.sheet__table td.blank {
  border-left: 0.25mm solid #000;
}

.sheet__yalniz {
  text-align: left;
  font-weight: 400;
  font-size: var(--yalniz-font);
  height: 8mm;
  white-space: nowrap;
  overflow: hidden;
}

.sheet__yalniz b {
  font-weight: 700;
  margin-right: 2mm;
}

/* --- Kesikli ayraç + büyük sayı --------------------------------------- */

.sheet__divider {
  margin: 9mm 0 0 0;
  border: 0;
  border-top: 0.4mm dashed #000;
  width: 100%;
}

.sheet__big {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: var(--big-area);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sheet__big span {
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-weight: 700;
  font-size: var(--big-font);
  line-height: 1;
  letter-spacing: -2px;
  white-space: nowrap;
}

/* --- Yönetim kurulu kaşesi ---------------------------------------------- */
/* Sayfaya göre konumlanır; sağ kenarı taşan kısım sayfa dışında kalır
   (.sheet overflow:hidden olduğu için kırpılır — Word çıktısındaki görünümün aynısı). */

.sheet__stamp {
  position: absolute;
  width: var(--stamp-w, 55mm);
  height: auto;
  left: var(--stamp-left, 151mm);
  top: var(--stamp-top, 140mm);
  pointer-events: none;
  /* Taslakta kaşe rakamların arkasında duran serbest bir nesnedir. */
  z-index: 0;
}

/* --- Ekran önizlemesi -------------------------------------------------- */

.sheet--preview {
  box-shadow: 0 2px 18px rgba(0, 0, 0, .18);
  border: 1px solid #d7d7de;
  margin: 0 auto;
  transform-origin: top center;
}

.preview-wrap {
  overflow: auto;
  background: #eceff3;
  padding: 18px;
  border-radius: 10px;
}

/* --- Yazdırma alanı ---------------------------------------------------- */

#print-root { display: none; }

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    width: 210mm;
  }

  /* Uygulama arayüzünün tamamı çıktıda gizlenir */
  body > *:not(#print-root) { display: none !important; }

  #print-root {
    display: block !important;
    margin: 0;
    padding: 0;
  }

  #print-root .sheet {
    box-shadow: none !important;
    border: 0 !important;
    margin: 0 !important;
    break-after: page;
    page-break-after: always;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Son sayfadan sonra boş sayfa oluşmasını engeller */
  #print-root .sheet:last-child {
    break-after: auto;
    page-break-after: auto;
    height: 296.6mm;
  }

  .sheet__table { break-inside: avoid; page-break-inside: avoid; }
}
