/* ============================================================
 * bdp-modal-core.css — BDP-style önizleme modal'ı ortak stil
 * ----------------------------------------------------------------
 * KGECICI_37 modal'ından çıkarılan paylaşılabilir CSS. Yeni
 * beyanname araçları <link rel="stylesheet" href="bdp-modal-core.css">
 * ile yükler.
 *
 * Renkler: Resmi slate/lacivert palet (BDP düzeni birebir, renk kurumsal)
 *   - Form arka planı:  #eef2f7 (açık pembe)
 *   - Section banner:   #c3cfdd (koyu pembe)
 *   - Tab aktif:        #eef2f7 (form rengi — tab seçildiğinde içerikle birleşir)
 *   - Tab pasif:        #e8e8e8 (gri)
 *   - Input arka planı: #fff (beyaz)
 *   - Input border:     #a8a8a8 (gri)
 *   - Toplam satırı:    #eaf2fb / #1e3a8a (pembe arka plan + koyu pembe metin)
 *
 * NOT: Bu CSS #bdpModal scope altında — tool'un sayfasında üst seviye
 * stillere çakışma yapmaz. Modal `<div id="bdpModal">` içinde olmalı.
 * ============================================================ */

#bdpModal,
#bdpModal * { font-style: normal !important; box-sizing: border-box; }

/* ── Modal kabuk ── */
#bdpModal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 9000; overflow: auto; padding: 20px; }
/* ── Inline mod (popup değil, sayfa içine gömülü) ── */
#bdpModal.bdp-inline { position: static !important; background: transparent !important; padding: 0 !important; z-index: auto !important; overflow: visible !important; }

/* ── Ana sekme bar ── */
.bdp-tab { background: #e8e8e8 !important; border: 1px solid #999; border-bottom: none; padding: 6px 14px; font-size: 11px; font-weight: 500 !important; cursor: pointer; color: #1a1a1a !important; border-radius: 4px 4px 0 0; margin-bottom: -1px; font-family: 'Segoe UI', Arial, sans-serif !important; }
.bdp-tab:hover { background: #f5f5f5 !important; }
.bdp-tab.bdp-tab-aktif { background: #eef2f7 !important; color: #1a1a1a !important; font-weight: 700 !important; border-bottom: 1px solid #eef2f7; z-index: 1; position: relative; }

/* ── Fieldset (eski stil, opsiyonel) ── */
.bdp-fieldset { border: 1px solid #b6c2d2; background: #eef2f7; margin-bottom: 12px; padding: 10px 14px 8px; position: relative; border-radius: 3px; }
.bdp-fieldset-title { position: absolute; top: -8px; left: 10px; background: #eef2f7; padding: 0 6px; color: #1a1a1a; font-weight: 600; font-size: 11px; }

/* ── Form satırı ── */
.bdp-form-satir { display: grid; grid-template-columns: 170px 1fr; gap: 8px; align-items: center; padding: 3px 0; font-size: 11px; }
.bdp-form-lbl { color: #000 !important; font-weight: 400 !important; text-align: left; line-height: 1.3; }
/* BDP konvansiyonu: Vergi/YİAGV/Düzenleme sekmelerinde etiketler lacivert (Leno slate teması) */
.bdp-mavi-lbl .bdp-form-lbl { color: #1e3a8a !important; }
.bdp-form-input { background: #fff !important; border: 1px solid #a8a8a8; border-radius: 2px; padding: 3px 7px; color: #000 !important; font-size: 11px; font-weight: 500 !important; font-family: 'Segoe UI', Arial, sans-serif !important; min-height: 20px; }
.bdp-form-input.num { text-align: right; font-family: 'Consolas', 'Courier New', monospace !important; font-weight: 600 !important; }
.bdp-form-input.kar { color: #0a6e2a !important; }
.bdp-form-input.zarar { color: #b91c1c !important; }

/* Editable input ─ focus efekti */
input.bdp-form-input, select.bdp-form-input, textarea.bdp-form-input { outline: none; width: 100%; height: 22px; line-height: 16px; }
input.bdp-form-input:focus, select.bdp-form-input:focus { border-color: #5b8ab9 !important; background: #fffef0 !important; box-shadow: 0 0 0 1px #5b8ab9; }
input.bdp-form-input:disabled, input.bdp-form-input[readonly] { background: #f0f0f0 !important; color: #555 !important; }
select.bdp-form-input { height: 24px; padding: 2px 5px; }
input.bdp-form-input.short { max-width: 120px; }
input.bdp-form-input.tiny { max-width: 70px; }

/* ── Tablo ── */
.bdp-tablo { width: 100%; border-collapse: collapse; font-size: 11px; border: 1px solid #a8a8a8; background: #fff; }
.bdp-tablo th { background: #d8e1ec !important; border: 1px solid #a8a8a8; padding: 5px 8px; text-align: left; font-weight: 700 !important; color: #1a1a1a !important; font-size: 11px; }
.bdp-tablo td { border: 1px solid #ccd6e1; padding: 4px 8px; background: #fff !important; color: #1a1a1a !important; font-weight: 400 !important; font-size: 11px; }
.bdp-tablo td.num { text-align: right; font-family: 'Consolas', 'Courier New', monospace !important; font-weight: 600 !important; color: #0a0a0a !important; }
.bdp-tablo tr.toplam-row { background: #eaf2fb !important; font-weight: 700 !important; }
.bdp-tablo tr.toplam-row td { background: #eaf2fb !important; font-weight: 700 !important; color: #1e3a8a !important; }

/* Inline tablo (Brüt Kazanç Dağılımı, İstisna Tablosu — tek satır + ekle/sil) */
.bdp-inline-tbl input.bdp-form-input { width: 100%; }
.bdp-inline-tbl td { padding: 3px; }

/* ── Section banner ── ("ZARAR OLSA DAHİ İNDİRİLECEK" tarzı koyu pembe başlık) */
.bdp-section-banner { background: #c3cfdd !important; color: #1a1a1a !important; font-weight: 700 !important; font-size: 11px; padding: 5px 10px; text-align: center; letter-spacing: .3px; border: 1px solid #a8a8a8; border-bottom: none; margin-top: 10px; }

/* ── 2-kolon layout ── (Ticari Kar + Üretim, Zarar + İhracat gibi) */
.bdp-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.bdp-2col .bdp-form-satir { grid-template-columns: 160px 1fr; }

/* ── ZARAR | KAR sütun layout ── */
.bdp-zarar-kar-head { display: grid; grid-template-columns: 170px 1fr 1fr; gap: 8px; align-items: center; padding: 6px 0 3px; font-size: 11px; font-weight: 700; }
.bdp-zarar-kar-head > div { text-align: center; color: #1a1a1a; }
.bdp-zarar-kar-row { display: grid; grid-template-columns: 170px 1fr 1fr; gap: 8px; align-items: center; padding: 3px 0; font-size: 11px; }

/* ── Sub-tab bar (alt sekme — Düzenleme/Ekler içindeki) ── */
.bdp-subtab-bar { background: #eef2f7; padding: 6px 4px 0; display: flex; flex-wrap: wrap; gap: 2px 1px; border-bottom: 1px solid #b6c2d2; margin-bottom: 8px; }
.bdp-subtab { background: #e8e8e8 !important; border: 1px solid #b8b8b8; border-bottom: none; padding: 4px 10px; font-size: 10.5px; font-weight: 500 !important; cursor: pointer; color: #1a1a1a !important; border-radius: 3px 3px 0 0; font-family: 'Segoe UI', Arial, sans-serif !important; margin-bottom: -1px; }
.bdp-subtab:hover { background: #f5f5f5 !important; }
.bdp-subtab.aktif { background: #fff !important; color: #1a1a1a !important; font-weight: 700 !important; border-bottom: 1px solid #fff; z-index: 1; position: relative; }
.bdp-subtab-icerik { background: #fff; border: 1px solid #b6c2d2; padding: 8px 10px; border-radius: 0 3px 3px 3px; }
.bdp-subtab-icerik .bdp-form-satir { grid-template-columns: 200px 1fr; }

/* ── Tablo aksiyon butonları (+ - delete) ── */
.bdp-tbl-wrap { display: grid; grid-template-columns: 1fr 20px; gap: 2px; align-items: start; }
.bdp-tbl-btns { display: flex; flex-direction: column; gap: 1px; }
.bdp-tbl-btn { background: #e8e8e8; border: 1px solid #999; width: 18px; height: 18px; cursor: pointer; font-size: 10px; padding: 0; color: #333; line-height: 1; }
.bdp-tbl-btn:hover { background: #f5f5f5; }
.bdp-tbl-btn.red { background: #fee; color: #c00; }
.bdp-tbl-btn.red:hover { background: #fdd; }

/* ── Toplam satırı (tabloların altında "Toplam" satırı) ── */
.bdp-toplam-satir { display: grid; grid-template-columns: 170px 1fr; gap: 8px; align-items: center; padding: 4px 8px; font-size: 11px; font-weight: 700; background: #dde6f1; border: 1px solid #a8a8a8; border-top: none; margin-bottom: 8px; }
.bdp-toplam-satir .bdp-form-lbl { font-weight: 700; }
.bdp-toplam-satir .bdp-form-input { background: #fffae8 !important; }

/* ── Dipnot ── (BDP'deki "*Cari yıl ..." gibi açıklamalar) */
.bdp-dipnot { font-size: 10.5px; color: #334155; padding: 6px 4px; line-height: 1.4; border-top: 1px dashed #b6c2d2; margin-top: 8px; }
.bdp-dipnot strong { color: #1a1a1a; font-weight: 700; }

/* ────────────────────────────────────────────────────────────
 * Inline yardım tooltip — alanların yanına "i" simgesi
 * Kullanım: <span class="info-tip" data-tip="Açıklama metni">i</span>
 * (Modal dışında da çalışır — tüm sayfalarda kullanılabilir.)
 * ──────────────────────────────────────────────────────────── */
.info-tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--cream-deep, #FEF3C7); color: var(--emerald, #D97706);
  border: 1px solid var(--mint, #FBBF24);
  font-family: 'Times New Roman', serif; font-style: italic !important;
  font-weight: 700; font-size: 11px; line-height: 1;
  cursor: help; user-select: none; margin-left: 6px;
  vertical-align: middle; position: relative; transition: all .15s;
  text-transform: none !important;   /* parent uppercase iken "i" "İ" olmasın */
  letter-spacing: 0 !important;
}
.info-tip:hover { background: var(--mint-deep, #F59E0B); color: #fff; border-color: var(--forest, #92400E); }
.info-tip::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: #ffffff; color: var(--gray-700, #374151);
  border: 1px solid var(--border-default, #E5E7EB); border-radius: 10px;
  padding: 10px 14px; font-size: 12px; font-weight: 400; font-style: normal !important;
  font-family: -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5; letter-spacing: .1px;
  white-space: pre-line; width: max-content; max-width: 320px;
  box-shadow: 0 12px 32px rgba(5, 46, 22, 0.12), 0 2px 6px rgba(5, 46, 22, 0.06);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .15s, visibility .15s; z-index: 9999;
}
.info-tip::before {
  content: ''; position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-top: 6px solid #ffffff;
  filter: drop-shadow(0 1px 0 var(--border-default, #E5E7EB));
  opacity: 0; visibility: hidden; transition: opacity .15s, visibility .15s; z-index: 9999;
}
.info-tip:hover::after, .info-tip:hover::before { opacity: 1; visibility: visible; }
/* Ekranın sağ tarafında olunca sola hizala */
.info-tip.right::after { left: auto; right: 0; transform: none; }
.info-tip.right::before { left: auto; right: 8px; transform: none; }
/* Modal içinde — pembe tema'ya uyumlu */
#bdpModal .info-tip { background: rgba(160, 30, 110, .12); color: #1e3a8a; border-color: rgba(160, 30, 110, .35); }
#bdpModal .info-tip:hover { background: #1e3a8a; color: #fff; }

/* ────────────────────────────────────────────────────────────
 * Mini stepper — sayfa üstünde yatay akış göstergesi
 * Kullanım: <div class="flow-stepper"><div class="flow-step" data-step="1">...</div>...</div>
 * JS ile aktif adımı işaretle: el.classList.add('active') veya 'done'
 * ──────────────────────────────────────────────────────────── */
.flow-stepper {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 14px 18px; margin-bottom: 18px;
  background: var(--cream-deep, #FEF3C7);
  border: 1px solid var(--mint, #FBBF24);
  border-radius: 12px;
}
.flow-step {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 13px; cursor: default;
  background: #ffffff;
  border: 1px solid var(--border-default, #E5E7EB);
  border-radius: 9px;
  font-size: 12px; color: var(--gray-600, #4B5563); font-weight: 600;
  transition: all .2s;
}
.flow-step .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  background: var(--bg-muted, #F3F4F6); color: var(--gray-500, #6B7280);
  border-radius: 50%; font-size: 11px; font-weight: 800;
  font-family: 'Consolas', monospace;
}
.flow-step.done {
  color: var(--emerald, #D97706);
  border-color: var(--mint, #FBBF24);
  background: var(--cream-deep, #FEF3C7);
}
.flow-step.done .num { background: var(--mint-deep, #F59E0B); color: #fff; }
.flow-step.done .num::before { content: '✓'; }
.flow-step.done .num span { display: none; }
.flow-step.active {
  color: #fff;
  background: linear-gradient(135deg, var(--forest, #92400E), var(--mint-deep, #F59E0B));
  border-color: var(--forest, #92400E);
  box-shadow: 0 4px 14px rgba(20, 83, 45, .25);
}
.flow-step.active .num { background: rgba(255, 255, 255, .25); color: #fff; }
.flow-arrow { color: var(--gray-400, #9CA3AF); font-size: 16px; font-weight: 300; user-select: none; }
@media (max-width: 900px) {
  .flow-stepper { flex-direction: column; align-items: stretch; gap: 4px; }
  .flow-arrow { transform: rotate(90deg); text-align: center; padding: 2px 0; }
  .flow-step { justify-content: flex-start; }
}

/* ────────────────────────────────────────────────────────────
 * Glossary terimleri — tıklayınca modal açar
 * Kullanım: <span class="terim" data-terim="KKEG">KKEG</span>
 * Veya: <a data-terim="KVK">KVK</a>
 * ──────────────────────────────────────────────────────────── */
.terim, [data-terim] {
  color: var(--emerald, #D97706) !important;
  text-decoration: underline dotted var(--mint-deep, #F59E0B) !important;
  text-underline-offset: 3px;
  cursor: help !important;
  transition: color .15s;
}
.terim:hover, [data-terim]:hover {
  color: var(--forest, #92400E) !important;
  text-decoration-color: var(--forest, #92400E) !important;
}
