/* ==========================================================================
   e-DEFTER GÖRÜNTÜLEYİCİ (mdosc/edefter.php, #100)
   Başlık, yükleme kartı, adımlar ve gizlilik banka çeviricinin sınıflarıyla (bank-converter.css);
   burada yalnız deftere özgü parçalar: başlık canlandırması, çalışma alanı (defterler + kontroller, defter sayfası).
   ========================================================================== */

/* ---------- Başlık canlandırması: XML → defter sayfası → kontroller → PDF ---------- */
.ed-demo { --sure: 8s; }
.ed-demo__file { display: flex; align-items: center; gap: 12px; padding: 4px 4px 10px; border-bottom: 1px solid var(--line); }
.ed-demo__file b { display: block; font-size: 14px; color: var(--ink); }
.ed-demo__file small { font-size: 12.5px; color: var(--muted); }
.ed-demo__book { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(var(--surface), var(--surface-2)); }
.ed-demo__bookhead { display: flex; justify-content: space-between; padding-bottom: 8px; border-bottom: 2px solid var(--ink); font-size: 12px; }
.ed-demo__bookhead b { letter-spacing: .08em; color: var(--navy-900); }
.ed-demo__bookhead span { color: var(--muted); }
.ed-demo__madde { display: grid; gap: 5px; }
.ed-demo__madde span { font-size: 11.5px; font-weight: 700; color: var(--navy-700); }
.ed-demo__madde i { width: var(--w); height: 8px; border-radius: 4px; background: var(--navy-50); }
.ed-demo__madde i.is-r { margin-left: auto; background: var(--line); }
.ed-demo__checks { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-demo__checks li { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--green-100); font-size: 12px; font-weight: 600; color: var(--green-700); }
.ed-demo__checks .i { width: 13px; height: 13px; stroke-width: 3; }

/* ---------- Yükleme kartı çubuğu ---------- */
.ed-bar__title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.ed-bar__title .i { width: 18px; height: 18px; color: var(--navy-700); }

/* ---------- Çalışma alanı (yükleme kartının içinde, dosyalar okununca yükleme alanının yerine) ---------- */
.ed-durum { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 64px 20px; font-size: 15px; color: var(--ink-2); }
.ed-durum .bc-spin { width: 26px; height: 26px; }
.ed-bos { margin: 0; padding: 40px 20px; text-align: center; font-size: 14px; color: var(--muted); }
.ed-hazirlik { margin: 0; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--navy-50); font-size: 14px; font-weight: 600; color: var(--navy-800); }
.ed-ekle { position: relative; cursor: pointer; }
.ed-ekle input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ed-ekle:focus-within { outline: 2px solid var(--navy-700); outline-offset: 2px; }
/* Yazdırma çerçevesi: görünmez, A4 genişliğinde */
.ed-yazdir { position: fixed; left: -10000px; top: 0; width: 210mm; height: 297mm; border: 0; visibility: hidden; }
.ed-ws__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.ed-ws__title strong { display: block; font-size: 16px; }
.ed-ws__title small { display: block; font-size: 13px; color: var(--muted); }
.ed-ws__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ed-ws__actions .btn { height: 42px; }

/* Görünüm seçici: Yevmiye / Büyük defter / Mizan */
.ed-seg { display: inline-flex; padding: 3px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--surface); }
.ed-seg button { height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.ed-seg button.is-on { background: var(--navy-900); color: #fff; }
.ed-seg button:focus-visible { outline: 2px solid var(--navy-700); outline-offset: 2px; }
.ed-seg button:disabled { opacity: .4; cursor: not-allowed; }
.ed-seg--kucuk button { height: 30px; padding: 0 10px; font-size: 13px; }
.ed-seg--kucuk button.is-on { background: var(--navy-50); color: var(--navy-900); box-shadow: inset 0 0 0 1px var(--navy-200); }

/* GİB görünümü: şablon çıktısı çerçevede, alana sığacak kadar küçültülür */
.ed-resmi { position: relative; margin: 0 auto; overflow: hidden; border-radius: 4px; background: #fff; box-shadow: 0 1px 3px rgb(11 26 51 / .08), 0 14px 34px -14px rgb(11 26 51 / .25); }
.ed-resmi iframe { position: absolute; top: 0; left: 0; border: 0; background: #fff; transform-origin: 0 0; }

.ed-ws__body { display: grid; grid-template-columns: 270px minmax(0, 1fr); height: min(78vh, 860px); min-height: 520px; }
/* Defter açıkken bölüm genişler (bank-converter.css .bc-result-section.is-live), çalışma alanı uzar */
.bc-result-section.is-live .ed-ws__body { grid-template-columns: 300px minmax(0, 1fr); height: min(86vh, 1100px); }
/* Tam ekran */
.ed-ws:fullscreen { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); }
.ed-ws:fullscreen .ed-ws__body { flex: 1; height: auto; min-height: 0; }
.ed-ws::backdrop { background: var(--surface); }
/* Sol: defterler, kontroller, toplamlar */
.ed-side { display: flex; flex-direction: column; gap: 14px; min-height: 0; padding: 16px; overflow: auto; overscroll-behavior: contain; border-right: 1px solid var(--line); background: var(--surface); }
.ed-side__label { margin: 0 0 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
/* Firma başlıkları (birden çok firma yüklendiğinde): açılır-kapanır */
.ed-firma + .ed-firma { margin-top: 6px; }
.ed-firma summary { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 12px; background: var(--surface-2); cursor: pointer; list-style: none; }
.ed-firma summary::-webkit-details-marker { display: none; }
.ed-firma summary:hover { background: var(--navy-50); }
.ed-firma summary:focus-visible { outline: 2px solid var(--navy-700); outline-offset: 2px; }
.ed-firma[open] summary { background: var(--navy-50); }
.ed-firma__ic { display: grid; flex: none; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--navy-800); color: #fff; }
.ed-firma__ic .i { width: 16px; height: 16px; }
.ed-firma__txt { min-width: 0; flex: 1; }
.ed-firma__txt strong { display: block; font-size: 13.5px; line-height: 1.3; color: var(--ink); }
.ed-firma__txt small { display: block; font-size: 12px; color: var(--muted); }
.ed-firma__ok { flex: none; width: 16px; height: 16px; color: var(--muted); transition: transform .2s; }
.ed-firma[open] .ed-firma__ok { transform: rotate(180deg); }
.ed-firma .ed-donemler { margin: 4px 0 0 14px; padding-left: 10px; border-left: 2px solid var(--line); }
/* Dönemler: ay, kısa özet, durum noktası */
.ed-donemler { display: grid; gap: 2px; }
.ed-donemler button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: background .15s;
}
.ed-donemler button:hover { background: var(--surface-2); }
.ed-donemler button.is-active { background: var(--navy-50); box-shadow: inset 3px 0 0 var(--navy-800); }
.ed-donemler button:focus-visible { outline: 2px solid var(--navy-700); outline-offset: 1px; }
.ed-donem__txt strong { display: block; font-size: 14px; }
.ed-donem__txt small { display: block; font-size: 12.5px; color: var(--muted); }
.ed-nokta { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.ed-nokta.is-ok { background: var(--green-600); }
.ed-nokta.is-warn { background: var(--amber-500); }
.ed-nokta.is-err { background: var(--red-600); }
.ed-nokta.is-yok { background: var(--line-strong); }
.ed-kontrol.is-yok { background: var(--surface-2); }
.ed-kontrol.is-yok header .i { background: var(--navy-700); }

/* Kontroller: tek kutu; başlıkta genel durum, satırlarda yalnız başlık (açıklama yalnız sorunlu satırda) */
.ed-kontrol { padding: 12px 14px; border-radius: 14px; background: rgb(220 243 233 / .5); }
.ed-kontrol.is-warn { background: rgb(252 239 212 / .65); }
.ed-kontrol.is-err { background: var(--red-50); }
.ed-kontrol header { display: flex; align-items: center; gap: 10px; }
.ed-kontrol header .i { flex: none; width: 28px; height: 28px; padding: 6px; border-radius: 50%; background: var(--green-600); color: #fff; stroke-width: 3; }
.ed-kontrol.is-warn header .i { background: var(--amber-500); }
.ed-kontrol.is-err header .i { background: var(--red-600); }
.ed-kontrol header strong { display: block; font-size: 14.5px; }
.ed-kontrol header small { display: block; font-size: 12.5px; color: var(--ink-2); }
.ed-kontrol__grup { margin: 10px 0 2px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ed-kontrol ul { display: grid; gap: 3px; margin-top: 8px; }
.ed-kontrol__grup + ul { margin-top: 2px; }
.ed-kontrol li { display: flex; gap: 8px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.ed-kontrol li .i { flex: none; width: 15px; height: 15px; margin-top: 2px; }
.ed-kontrol li.is-ok .i { color: var(--green-700); }
.ed-kontrol li.is-warn .i { color: var(--amber-600); }
.ed-kontrol li.is-err .i { color: var(--red-600); }
.ed-kontrol li small { display: block; font-size: 12px; color: var(--muted); }

/* Kısa özet */
.ed-ozet { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 0; padding: 0 2px; }
.ed-ozet dt { font-size: 12px; color: var(--muted); }
.ed-ozet dd { margin: 0; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ed-ozet .is-genis { grid-column: 1 / -1; }

/* Başlıktaki "Temizle": düğme değil, sade bağlantı */
.ed-link { padding: 0 6px; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ed-link:hover { color: var(--ink); }
.ed-klasor-btn { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
.ed-klasor-ipucu { font-size: 12.5px; color: var(--muted); }
.ed-skip { margin-top: 4px; font-size: 13px; }
.ed-skip summary { font-weight: 600; color: var(--amber-600); cursor: pointer; }
.ed-skip ul { display: grid; gap: 4px; max-height: 220px; margin: 8px 0 0; overflow: auto; color: var(--ink-2); }
.ed-skip b { font-weight: 600; word-break: break-all; }

/* Sağ: defter sayfası önizlemesi */
.ed-preview { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg-alt); }
.ed-preview__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.ed-preview__bar .ed-sayfa { margin-left: auto; }
.ed-sayfa { display: flex; flex: none; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.ed-sayfa input { width: 58px; height: 32px; padding: 0 6px; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; text-align: center; }
.ed-search { display: flex; flex: 1 1 200px; max-width: 320px; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }
.ed-search .i { width: 16px; height: 16px; color: var(--muted); }
.ed-search input { flex: 1; min-width: 0; height: 36px; border: 0; background: none; font: inherit; font-size: 14px; outline: none; }
.ed-search:focus-within { border-color: var(--navy-700); box-shadow: 0 0 0 3px var(--navy-100); }
.ed-preview__stage { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 24px; }

/* Defter sayfası (örnek görünüm) */
/* Sayfa her zaman aynı genişlikte çizilir; dar alanda edefter.js küçültür (zoom), tablo düzeni bozulmaz */
.ed-page {
  width: 760px;
  margin: 0 auto;
  padding: 26px 28px;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 1px 3px rgb(11 26 51 / .08), 0 14px 34px -14px rgb(11 26 51 / .25);
  font-size: 11.5px;
  line-height: 1.45;
  color: #1c2333;
}
.ed-page__head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 16px; padding-bottom: 10px; border-bottom: 2px solid #1c2333; }
.ed-page__head strong { display: block; font-size: 12.5px; }
.ed-page__head span { display: block; color: #3a4660; }
.ed-page__title { text-align: center; }
.ed-page__title b { display: block; font-size: 14px; letter-spacing: .12em; }
.ed-page__no { text-align: right; font-weight: 700; }
.ed-page__table { width: 100%; margin-top: 10px; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.ed-page__table td { overflow-wrap: anywhere; }
.ed-page__table th { padding: 5px 6px; border-bottom: 1px solid #1c2333; font-size: 10.5px; text-align: left; text-transform: uppercase; letter-spacing: .03em; }
.ed-page__table td { padding: 3px 6px; vertical-align: top; }
.ed-page__table .n { text-align: right; white-space: nowrap; }
.ed-page__table small { color: #67718a; }
.ed-madde + .ed-madde .ed-madde__head td { border-top: 1px dashed #b9c1cf; }
.ed-madde__head td { padding-top: 8px; font-weight: 700; }
.ed-madde__head td:nth-child(3) { font-weight: 600; color: #3a4660; }
.ed-page__table td.is-alacak { padding-left: 26px; } /* alacak satırı içeriden: basılı yevmiye geleneği */
.ed-page__table tfoot td { padding-top: 8px; border-top: 2px solid #1c2333; font-weight: 800; }
.ed-page__table small.ed-not { display: block; }
.ed-devir td { padding-top: 6px; border-bottom: 1px solid #b9c1cf; font-weight: 700; color: #3a4660; }
.ed-hesap td { padding-top: 10px; border-bottom: 1px solid #1c2333; font-weight: 800; }
.ed-hesap-top td { border-top: 1px solid #b9c1cf; font-weight: 700; }
.ed-page__not { margin: 10px 0 0; font-size: 10.5px; color: #67718a; }
.ed-berat th { width: 26%; padding: 3px 6px; text-align: left; font-weight: 600; color: #3a4660; vertical-align: top; }
.ed-berat__baslik td { padding: 4px 6px 8px; font-size: 14px; font-weight: 800; letter-spacing: .06em; border-bottom: 2px solid #1c2333; }
.ed-berat__baslik span { float: right; font-size: 11px; font-weight: 700; letter-spacing: 0; color: #05704b; }
.ed-berat__bolum td { padding: 12px 6px 4px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid #b9c1cf; }
.ed-berat__tablo th { width: auto; border-bottom: 1px solid #1c2333; font-size: 10.5px; text-transform: uppercase; }
.ed-imza { font-family: Consolas, monospace; font-size: 10px; word-break: break-all; color: #3a4660; }
.ed-page + .ed-page { margin-top: 24px; }

/* ---------- Okunan / okunmayan dosyalar ---------- */
.ed-files { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ed-files__col { padding: 26px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.ed-files__col h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 1.125rem; }
.ed-files__col h3 .i { width: 28px; height: 28px; padding: 6px; border-radius: 50%; background: var(--green-100); color: var(--green-700); }
.ed-files__col.is-no h3 .i { background: var(--red-50); color: var(--red-600); }
.ed-files__col ul { display: grid; gap: 12px; }
.ed-files__col li { font-size: var(--fs-sm); line-height: 1.6; color: var(--muted); }
.ed-files__col li strong { display: block; font-size: 15px; color: var(--ink); }
.ed-files__col code { padding: 1px 5px; border-radius: 5px; background: var(--navy-50); font-size: 12.5px; color: var(--navy-800); }
.ed-files__col a { color: var(--navy-800); text-decoration: underline; }

@media (max-width: 1080px) {
  .ed-ws__body { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .ed-side { border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .ed-donemler { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
  .ed-donemler li { flex: none; }
  .ed-donemler button { border: 1px solid var(--line); }
  .ed-donemler button.is-active { border-color: var(--navy-800); box-shadow: none; }
  .ed-preview__stage { max-height: 75vh; }
}
@media (max-width: 640px) {
  .ed-files { grid-template-columns: 1fr; }
  .ed-ws__actions { width: 100%; }
  .ed-ws__actions .ed-link { order: 3; width: 100%; padding: 4px 0 0; text-align: center; }
  .ed-seg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .ed-search { max-width: none; }
  .ed-seg button { flex: 1; padding: 0 6px; font-size: 13px; white-space: nowrap; }
  .ed-ws__actions .btn { flex: 1 1 auto; }
  .ed-preview__stage { padding: 12px; }
}
