/* ============================================================================
 * mobile-shim.css
 * Kazanci endeks/icerik sayfalari icin mobil-uyumluluk + Bootstrap-esinli stil.
 *
 * Hedef: K:\paketler\anaibb master HTM dosyalarina dokunmadan, linkweb.pl
 * tarafindan <head>'e enjekte edilen tek CSS dosyasi ile yuzlerce eski sayfayi
 * mobil ekranlarda okunabilir + estetik hale getirmek.
 *
 * Yontem: HTML/markup'a yeni class eklemiyoruz; mobile-shim.js sayfayi
 * yukledikten sonra her TR'e semantik bir class atiyor:
 *
 *   tr.kh-pagetitle  : <th colspan> iceren TR (sayfa basligi)
 *   tr.kh-colhead    : sadece <th> iceren TR (kolon basliklari)
 *   tr.kh-fltrow     : TableFilter'in <tr class="fltrow"> input satiri
 *   tr.kh-card       : Veri TR'leri (mobilde kart formatinda gosterilir)
 *
 * Bu sayede DOM pozisyonu (nth-child sayma) onemini kaybeder. TableFilter'in
 * fltrow'u dinamik eklemesi, promoteThead'in TR'leri thead'e tasimasi,
 * dash-placeholder TR'lerin silinmesi - hicbiri CSS'i bozmaz.
 *
 * Kazanci'nin mevcut style_yeni.css'i agir kurallar koyuyor:
 *   BODY { background: url(brown.jpg); font-family: Arial; text-align: center }
 *   A:link    { color: #964020; font-size: 14px; font-weight: bold }
 *   A:visited { color: #000;    font-size: 12px }
 *   TD        { font-family: 'Times New Roman'; font-size: 13px }
 *
 * Pseudo-class selectorler (a:link, a:visited) higher specificity oldugu
 * icin tum override'lar !important ile yapilir.
 *
 * Renk paleti:
 *   Primary  #ffc107  (amber)   - TH bg, navbar, alfa rozet
 *   Dark     #212529  (siyah)   - text, border accent
 *   Alert bg #fff3cd  (acik sari)
 *   Help red #b50000           - filter ipucu
 *   Link     #0d6efd           - mavi
 *   Visited  #6f42c1           - mor
 * ========================================================================== */

/* ---------- 1) Reset (kazanci style_yeni.css override) ---------- */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(255, 193, 7, 0.25);
}

body,
body.kh-shim {
  margin: 0 !important;
  padding: 0 !important;
  background: #ffffff !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif !important;
  font-size: 15px !important;
  line-height: 1.5 !important;
  color: #212529 !important;
  text-align: left !important;
}

.kh-content {
  padding: 8px 10px 80px;
  max-width: 1280px;
  margin: 0 auto;
}

/* ---------- 2) Mobil ust navbar ---------- */

.kh-mobile-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #ffc107;
  color: #212529;
  border-bottom: 1px solid #212529;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
  font-size: 14px;
}

.kh-mobile-nav .kh-nav-back,
.kh-mobile-nav .kh-nav-home {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #212529;
  border-radius: 4px;
  color: #212529 !important;
  background: rgba(255, 255, 255, 0.55);
  text-decoration: none !important;
  font-size: 16px;
  font-weight: 600 !important;
  cursor: pointer;
  -webkit-appearance: none;
       -moz-appearance: none;
            appearance: none;
}

.kh-mobile-nav .kh-nav-back:active,
.kh-mobile-nav .kh-nav-home:active {
  background: #ffffff;
}

.kh-mobile-nav .kh-nav-title {
  flex: 1 1 auto;
  font-weight: 600;
  font-size: 14px;
  color: #212529;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 3) Breadcrumb ---------- */

.kh-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
  margin: 8px 0 6px;
  padding: 6px 10px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  font-size: 13px;
  color: #6c757d;
}

.kh-breadcrumb a,
.kh-breadcrumb a:link,
.kh-breadcrumb a:visited {
  color: #0d6efd !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  text-decoration: none !important;
}

.kh-breadcrumb a:hover { text-decoration: underline !important; }

.kh-breadcrumb .kh-bc-sep {
  color: #adb5bd;
  font-size: 12px;
}

.kh-breadcrumb .kh-bc-active {
  color: #495057;
  font-weight: 500;
}

/* Modul kokunde home icon (U+1F3E0). Linkin solunda kucuk ev simgesi. */
.kh-breadcrumb a.kh-bc-home {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.kh-breadcrumb .kh-bc-home-icon {
  font-size: 14px;
  line-height: 1;
  /* Eski tarayicilarda emoji rendering tutarsiz; bir tik yukari kaldir */
  position: relative;
  top: -1px;
}

/* ---------- 4) Sayfa basligi (.kh-pagetitle) ---------- */

table tr.kh-pagetitle th[colspan],
table tr.kh-pagetitle th {
  background: #fff3cd !important;
  color: #856404 !important;
  border: 2px solid #212529 !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  font-style: italic !important;
  text-align: center !important;
  padding: 10px 12px !important;
  letter-spacing: 0.3px;
  white-space: normal !important;
  word-wrap: break-word !important;
  position: static !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
  table tr.kh-pagetitle th {
    font-size: 0.85rem !important;
    padding: 8px 10px !important;
    line-height: 1.3;
  }
}

/* ---------- 5) Tablo (desktop) ---------- */

table[border],
table[border="1"],
table#khk_ibb,
table#hebb_ibb,
table#mbb_ibb {
  width: 100% !important;
  border-collapse: collapse !important;
  border: 0 !important;
  margin: 8px 0 12px !important;
  background: #ffffff !important;
  font-size: 14px !important;
  font-family: inherit !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.kh-table-scroll {
  width: 100%;
  margin: 8px 0 12px;
  border-radius: 4px;
  background: #ffffff;
}
.kh-table-scroll > table {
  margin: 0 !important;
  box-shadow: none;
  border-radius: 0;
}

/* ---------- 6) TH (kolon basliklari) - desktop ---------- */

table tr.kh-colhead th {
  background: #ffc107 !important;
  color: #212529 !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  font-family: inherit !important;
  text-align: left !important;
  padding: 8px 10px !important;
  border: 1px solid #d39e00 !important;
  vertical-align: top !important;
  white-space: normal !important;
}

/* TH icindeki kirmizi font uyari notlari (siyaha cevrildi) */
table tr.kh-colhead th font[color="red"] {
  display: block !important;
  margin-top: 2px !important;
  font-weight: 400 !important;
  font-size: 0.7rem !important;
  line-height: 1.15 !important;
  color: #212529 !important;
}

table tr.kh-colhead th u {
  text-decoration: none !important;
}

/* ---------- 7) TD (veri hucreleri) ---------- */

table tr.kh-card td {
  padding: 7px 10px !important;
  border: 1px solid #dee2e6 !important;
  border-left: 0 !important;
  border-right: 0 !important;
  vertical-align: top !important;
  background: #ffffff !important;
  line-height: 1.45 !important;
  font-family: inherit !important;
  font-size: 14px !important;
  color: #212529 !important;
}

table tr.kh-card:nth-child(odd) td {
  background: rgba(0, 0, 0, 0.025) !important;
}

table tr.kh-card:hover td {
  background: rgba(255, 193, 7, 0.10) !important;
}

table#khk_ibb tr.kh-card td:nth-child(1) {
  font-weight: 600 !important;
  white-space: nowrap !important;
  color: #495057 !important;
}

table#khk_ibb tr.kh-card td:nth-child(2),
table#khk_ibb tr.kh-card td:nth-child(3) {
  white-space: nowrap !important;
  color: #6c757d !important;
  font-size: 0.875rem !important;
}

table#khk_ibb tr.kh-card td:nth-child(4) {
  word-break: break-word !important;
  line-height: 1.45 !important;
}

/* ---------- 8) Linkler - kazanci a:link/visited override ---------- */

table tr.kh-card td a,
table tr.kh-card td a:link,
table#khk_ibb td a,
table#khk_ibb td a:link {
  color: #0d6efd !important;
  font-size: inherit !important;
  font-weight: 600 !important;
  font-family: inherit !important;
  text-decoration: none !important;
}

/* Ziyaret edilen linkler mor (acilmis kararlar belli olsun) */
table tr.kh-card td a:visited,
table#khk_ibb td a:visited {
  color: #6f42c1 !important;
}

table tr.kh-card td a:hover,
table#khk_ibb td a:hover {
  color: #0a58ca !important;
  text-decoration: underline !important;
}

table tr.kh-card td a:active,
table#khk_ibb td a:active {
  color: #084298 !important;
}

/* Anchor (a name=X) - link gibi davranma */
table tr.kh-card td a[name],
table#khk_ibb td a[name] {
  font-size: inherit !important;
  font-weight: inherit !important;
  text-decoration: none !important;
}

/* ---------- 8b) a.info kavram preview (SAF CSS, JS'e bagimsiz) ----------
   Kaynak: <a class=info>E. .../K. ...<span>kavramlar</span></a>
   Span normalde gizli; hover / focus / tap ile gosterilir.
   Konum position:fixed ile viewport kenarina sabitlenir -> JS calismasa bile
   her zaman ekran icinde kalir. iOS'ta :hover iceren ogede ilk dokunis hover'i
   tetikler, ikinci dokunis linke gider (tap-preview boylece calisir). */
body.kh-shim a.info {
  position: relative;
}

body.kh-shim a.info span {
  display: none;
}

/* Desktop: sag-ust kosede sabit panel; her zaman okunabilir */
body.kh-shim a.info:hover span,
body.kh-shim a.info:focus span {
  display: block;
  position: fixed;
  top: 72px;
  right: 10px;
  bottom: auto;
  left: auto;
  z-index: 10000;
  box-sizing: border-box;
  width: auto;
  max-width: min(480px, calc(100vw - 20px));
  max-height: 70vh;
  overflow: auto;
  padding: 10px 12px;
  border: 2px solid #ffc107;
  border-radius: 6px;
  background: #ffffff;
  color: #212529;
  font-size: 13px;
  font-weight: normal;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

/* Mobil: ekranin altina sabit; tap ile acilir, hicbir zaman tasmaz */
@media (max-width: 768px) {
  body.kh-shim a.info:hover span,
  body.kh-shim a.info:active span,
  body.kh-shim a.info:focus span {
    top: auto;
    right: 8px;
    bottom: 8px;
    left: 8px;
    max-width: none;
    max-height: 55vh;
    font-size: 14px;
  }
}

/* ---------- 9) TableFilter input row (.kh-fltrow) ---------- */

table tr.kh-fltrow td {
  background: #fffceb !important;
  padding: 4px 6px !important;
  border-bottom: 2px solid #ffc107 !important;
}

table tr.kh-fltrow input,
table tr.kh-fltrow input.flt {
  width: 100% !important;
  min-height: 32px !important;
  padding: 5px 8px !important;
  border: 1px solid #ced4da !important;
  border-radius: 3px !important;
  font-size: 0.85rem !important;
  font-family: inherit !important;
  box-sizing: border-box !important;
  background: #ffffff !important;
  color: #212529 !important;
}

table tr.kh-fltrow input:focus {
  outline: 0 !important;
  border-color: #ffc107 !important;
  box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.25) !important;
}

table tr.kh-fltrow input::placeholder {
  color: #adb5bd;
  font-style: italic;
  opacity: 1;
}
table tr.kh-fltrow input::-webkit-input-placeholder {
  color: #adb5bd;
  font-style: italic;
}

/* TableFilter toolbar (infDiv) */
div[id^="inf_"] {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 6px 0 !important;
  padding: 6px 10px !important;
  background: #f8f9fa !important;
  border: 1px solid #e9ecef !important;
  border-radius: 4px !important;
  font-size: 0.8rem !important;
  color: #495057 !important;
}

div[id^="ldiv_"],
div[id^="mdiv_"] {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin: 0 !important;
  float: none !important;
  width: auto !important;
}

/* ? + Suzgecleri sil -> panelin sagina */
div[id^="rdiv_"] {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin: 0 0 0 auto !important;
  float: none !important;
  width: auto !important;
  text-align: right !important;
}

.reset,
a.reset,
span.reset,
input.reset,
input[type="button"].reset {
  /* filtergrid.css 19x19 image-button kuralini tam override et.
     Reset butonu artik text-based: mobile-shim.js value'yi
     "Suzgecleri sil" olarak dolduruyor. */
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  height: auto !important;
  min-height: 30px !important;
  padding: 4px 12px !important;
  margin: 0 !important;
  background-image: none !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  font-family: inherit !important;
  color: #212529 !important;
  background: #ffffff !important;
  border: 1px solid #ced4da !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  text-decoration: none !important;
  white-space: nowrap;
}
.reset:hover,
input.reset:hover,
input[type="button"].reset:hover {
  background: #fff3cd !important;
  background-image: none !important;
  border-color: #ffc107 !important;
}
.reset:active,
input.reset:active,
input[type="button"].reset:active {
  background: #ffe69c !important;
  background-image: none !important;
}

div[id^="load_"] {
  display: none !important;
}

#lblStatus,
.tot,
.tot_class,
span[id^="totRowsTextSpan_"],
span[id^="totrows_span_"] {
  display: inline-block !important;
  margin: 0 4px !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  color: #6c757d !important;
}
span[id^="totrows_span_"] {
  color: #856404 !important;
  font-weight: 600 !important;
}

/* ---------- 10) Eski font/legacy tag normalize ---------- */

font[face]  { font-family: inherit !important; }
font[size]  { font-size: inherit !important; }
font[color="red"] { color: #212529 !important; }

/* ---------- 11) Alfa rozet (<center><a name=X><h1>X</h1></a>) ---------- */

td > center > a[name] > h1,
td > center > a > h1 {
  display: inline-block !important;
  min-width: 26px;
  padding: 2px 8px;
  margin: 0 6px 4px 0 !important;
  background: #ffc107 !important;
  color: #212529 !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  line-height: 1.2 !important;
  text-align: center !important;
  border-radius: 4px;
  border: 1px solid #d39e00;
  text-decoration: none !important;
  vertical-align: middle;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

td > center {
  display: inline !important;
  margin: 0 !important;
  text-align: left !important;
}

td > center > a[name] {
  text-decoration: none !important;
}

a[name],
[id] {
  scroll-margin-top: 80px;
}
@media (max-width: 768px) {
  a[name],
  [id] {
    scroll-margin-top: 110px;
  }
}

/* ---------- 12) Genel basliklar ---------- */

h1, h2, h3, h4, h5, h6 {
  font-family: inherit !important;
  color: #212529 !important;
  margin: 0.5em 0 0.25em !important;
}

/* =============================================================
 * MOBILE - tablo CARD layoutuna donusur (max-width: 768px)
 * =============================================================*/

@media (max-width: 768px) {
  body { font-size: 14px !important; }
  .kh-content { padding: 6px 8px 70px; }

  .kh-table-scroll {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  /* Tablo, tbody, thead -> block */
  table#khk_ibb,
  table[border],
  table[border="1"] {
    display: block !important;
    width: 100% !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
  }

  table#khk_ibb tbody,
  table[border] tbody,
  table[border="1"] tbody,
  table#khk_ibb thead,
  table[border] thead,
  table[border="1"] thead {
    display: block !important;
    width: 100% !important;
  }

  /* Sayfa basligi (.kh-pagetitle) - tam genislik */
  table tr.kh-pagetitle {
    display: block !important;
    width: 100% !important;
    margin: 0 0 6px !important;
    background: transparent !important;
  }
  table tr.kh-pagetitle th {
    display: block !important;
    width: auto !important;
  }

  /* Kolon basliklari (.kh-colhead) - mobilde gizle */
  table tr.kh-colhead {
    display: none !important;
  }

  /* Filter row (.kh-fltrow) - <tr> uzerinde display:flex/grid bazi
     tarayicilarda height auto-grow yapmiyor (cocuklar overflow ediyor).
     En geri-uyumlu yontem: display:block + inline-block TD'ler. */
  table tr.kh-fltrow {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    padding: 10px 12px !important;
    margin: 4px 0 12px !important;
    background: #fffceb !important;
    border: 1px solid #ffc107 !important;
    border-radius: 6px !important;
    box-shadow: 0 1px 2px rgba(255, 193, 7, 0.15);
    box-sizing: border-box !important;
    font-size: 0 !important; /* TD'ler arasi whitespace'i sil */
    overflow: visible !important;
  }
  table tr.kh-fltrow td {
    display: inline-block !important;
    vertical-align: top !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
    font-size: 14px !important; /* parent font-size:0'i sifirla */
    min-width: 0 !important;
  }
  /* td1, td2 -> yarisar genislik, yan yana */
  table tr.kh-fltrow td:nth-child(1),
  table tr.kh-fltrow td:nth-child(2) {
    width: calc(50% - 4px) !important;
  }
  table tr.kh-fltrow td:nth-child(1) {
    margin-right: 8px !important;
  }
  /* td3 (Tarih), td4 (KHK adi) -> her biri yeni satirda full width */
  table tr.kh-fltrow td:nth-child(3),
  table tr.kh-fltrow td:nth-child(4) {
    display: block !important;
    width: 100% !important;
    margin-top: 6px !important;
  }

  /* iOS Safari: input font-size < 16px ise focus aninda auto-zoom yapar
     ve zoom geri alinmaz - viewport trim oluyor (klasik iOS hatasi).
     Tum form input'larini mobilde 16px'e cikar. Desktop kuralinin
     ustune yazmak icin asagidaki secicinin kh-fltrow degil de generic
     olmasi gerekiyor (input[type] vs.) - higher specificity ile. */
  table tr.kh-fltrow input,
  table tr.kh-fltrow input.flt,
  table tr.kh-fltrow td input,
  input[type="text"],
  input[type="search"],
  input[type="email"],
  input[type="number"],
  input[type="tel"],
  input[type="url"],
  input[type="password"],
  input:not([type]),
  textarea,
  select {
    font-size: 16px !important;
  }

  /* Veri kartlari (.kh-card) */
  table tr.kh-card {
    display: flex !important;
    flex-direction: column !important;
    width: auto !important;
    padding: 12px 14px !important;
    margin: 0 0 8px !important;
    background: #ffffff !important;
    border: 1px solid #e9ecef !important;
    border-left: 4px solid #ffc107 !important;
    border-radius: 4px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
  }

  /* TableFilter aktif filter ile inline style="display:none" set ediyor.
     Mobilde card layout'tan dolayi !important kuralimiz onu yeniyordu.
     Attribute selector ile daha yuksek specificity vererek filter'i restore et. */
  table tr.kh-card[style*="display: none"],
  table tr.kh-card[style*="display:none"] {
    display: none !important;
  }

  table tr.kh-card:nth-of-type(odd) {
    background: #fffdf6 !important;
  }

  table tr.kh-card td {
    display: block !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    width: auto !important;
    white-space: normal !important;
  }

  /* KHK ADI (4. TD) - kartin BASINDA, buyuk text */
  table#khk_ibb tr.kh-card td:nth-child(4) {
    order: 1 !important;
    font-size: 0.92rem !important;
    line-height: 1.5 !important;
    color: #212529 !important;
    margin-bottom: 6px !important;
    word-break: break-word !important;
  }

  /* KHK NO (1. TD) - badge gibi */
  table#khk_ibb tr.kh-card td:nth-child(1) {
    order: 2 !important;
    display: inline-block !important;
    width: fit-content !important;
    padding: 2px 8px !important;
    margin: 0 6px 4px 0 !important;
    background: #fff3cd !important;
    color: #856404 !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    border: 1px solid #ffeaa0 !important;
    border-radius: 3px !important;
    white-space: nowrap !important;
  }

  /* RG NO + RG TARIH (2. ve 3. TD) - inline gri */
  table#khk_ibb tr.kh-card td:nth-child(2),
  table#khk_ibb tr.kh-card td:nth-child(3) {
    order: 3 !important;
    display: inline !important;
    font-size: 0.75rem !important;
    color: #6c757d !important;
    margin-right: 6px !important;
  }

  /* Meta prefix labels - CSS-only */
  table#khk_ibb tr.kh-card td:nth-child(2)::before {
    content: "R.G. " !important;
    color: #adb5bd;
    font-weight: 500;
  }
  table#khk_ibb tr.kh-card td:nth-child(3)::before {
    content: " \00B7 " !important;
    color: #adb5bd;
  }

  /* Link mobilde */
  table#khk_ibb td a,
  table#khk_ibb td a:link,
  table#khk_ibb td a:visited {
    display: inline !important;
    line-height: 1.5 !important;
  }

  /* Alfa rozet mobilde */
  td > center > a[name] > h1,
  td > center > a > h1 {
    min-width: 28px;
    padding: 3px 10px !important;
    font-size: 1rem !important;
    margin-right: 8px !important;
  }
}

/* ---------- 13) Print ---------- */

@media print {
  .kh-mobile-nav,
  .kh-breadcrumb { display: none !important; }
  .kh-content { padding: 0; }
  body { background: #fff !important; }

  table[border],
  table[border="1"],
  table#khk_ibb {
    box-shadow: none !important;
    border: 1px solid #000 !important;
    display: table !important;
  }
  table tr.kh-card {
    display: table-row !important;
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
  }
  table tr.kh-card td,
  table tr.kh-colhead th {
    display: table-cell !important;
    border: 1px solid #888 !important;
    padding: 4px 8px !important;
  }
  table tr.kh-pagetitle th {
    background: #fff !important;
    color: #000 !important;
    border: 2px solid #000 !important;
  }
  table tr.kh-colhead {
    display: table-row !important;
  }
  table tr.kh-colhead th {
    background: #ddd !important;
    color: #000 !important;
  }
  td > center > a[name] > h1 {
    background: #000 !important;
    color: #fff !important;
    border: 1px solid #000 !important;
  }
}

/* ---------- 14) Cok kucuk ekranlar ---------- */

@media (max-width: 360px) {
  .kh-mobile-nav { font-size: 13px; padding: 5px 8px; }
  .kh-mobile-nav .kh-nav-back,
  .kh-mobile-nav .kh-nav-home {
    min-width: 34px;
    min-height: 34px;
    padding: 0 6px;
    font-size: 14px;
  }
  .kh-content { padding: 6px 6px 60px; }
  table tr.kh-pagetitle th { font-size: 0.8rem !important; }
}

/* ============================================================================
 * 15) MBB MAVI TEMA  -  body.kh-mbb
 * Mevzuat Bilgi Bankasi sayfalari Ictihat'tan (sari) ayirt edilsin diye
 * mavi tonlu. Ayni shim; kurallar body.kh-mbb ile kapsamlandi, dosyanin
 * sonunda oldugu icin sari kurallari ezer. IBB (kh-mbb yok) etkilenmez.
 * Mavi palet: #0d6efd (ana), #0a58ca/#084298 (koyu), #cfe2ff (acik bg),
 *             #f0f6ff / #f5f9ff (cok acik bg), #ffffff (koyu mavi uzeri yazi)
 * ========================================================================== */

/* Ust navbar */
body.kh-mbb .kh-mobile-nav {
  background: #0d6efd;
  color: #ffffff;
  border-bottom-color: #084298;
}
body.kh-mbb .kh-mobile-nav .kh-nav-title { color: #ffffff; }
body.kh-mbb .kh-mobile-nav .kh-nav-back,
body.kh-mbb .kh-mobile-nav .kh-nav-home {
  color: #0d3d8f !important;
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.85);
}
body.kh-mbb .kh-mobile-nav .kh-nav-back:active,
body.kh-mbb .kh-mobile-nav .kh-nav-home:active {
  background: #ffffff;
}

/* Sayfa basligi (.kh-pagetitle) */
body.kh-mbb table tr.kh-pagetitle th[colspan],
body.kh-mbb table tr.kh-pagetitle th {
  background: #cfe2ff !important;
  color: #084298 !important;
}

/* Kolon basliklari (.kh-colhead) */
body.kh-mbb table tr.kh-colhead th {
  background: #0d6efd !important;
  color: #ffffff !important;
  border-color: #0a58ca !important;
}

/* Card hover */
body.kh-mbb table tr.kh-card:hover td {
  background: rgba(13, 110, 253, 0.10) !important;
}

/* a.info kavram preview cercevesi */
body.kh-mbb a.info:hover span,
body.kh-mbb a.info:focus span {
  border-color: #0d6efd;
}

/* TableFilter input satiri */
body.kh-mbb table tr.kh-fltrow td {
  background: #f0f6ff !important;
  border-bottom-color: #0d6efd !important;
}
body.kh-mbb table tr.kh-fltrow input:focus {
  border-color: #0d6efd !important;
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25) !important;
}

/* Suzgecleri sil butonu */
body.kh-mbb .reset:hover,
body.kh-mbb input.reset:hover,
body.kh-mbb input[type="button"].reset:hover {
  background: #cfe2ff !important;
  border-color: #0d6efd !important;
}
body.kh-mbb .reset:active,
body.kh-mbb input.reset:active,
body.kh-mbb input[type="button"].reset:active {
  background: #9ec5fe !important;
}

/* Toplam satir sayaci */
body.kh-mbb span[id^="totrows_span_"] {
  color: #084298 !important;
}

/* Alfa rozet (<center><a name=X><h1>X</h1>) */
body.kh-mbb td > center > a[name] > h1,
body.kh-mbb td > center > a > h1 {
  background: #0d6efd !important;
  color: #ffffff !important;
  border-color: #0a58ca !important;
}

/* Mobil (max-width:768px) */
@media (max-width: 768px) {
  body.kh-mbb table tr.kh-fltrow {
    background: #f0f6ff !important;
    border-color: #0d6efd !important;
    box-shadow: 0 1px 2px rgba(13, 110, 253, 0.15);
  }
  body.kh-mbb table tr.kh-card {
    border-left-color: #0d6efd !important;
  }
  body.kh-mbb table tr.kh-card:nth-of-type(odd) {
    background: #f5f9ff !important;
  }
  body.kh-mbb table#khk_ibb tr.kh-card td:nth-child(1) {
    background: #cfe2ff !important;
    color: #084298 !important;
    border-color: #b6d4fe !important;
  }
}

/* ============================================================================
 * 16) HEBB YESIL TEMA  -  body.kh-hebb
 * Hukuk Eserleri Bilgi Bankasi sayfalari IBB (sari) / MBB (mavi)'den ayirt
 * edilsin diye yesil tonlu. Palet: #198754 (Bootstrap success-green),
 * #0f5132 (koyu), #d1e7dd (acik bg), #f0faf5 / #f5fff9 (cok acik bg).
 * ========================================================================== */

/* Ust navbar */
body.kh-hebb .kh-mobile-nav {
  background: #198754;
  color: #ffffff;
  border-bottom-color: #0f5132;
}
body.kh-hebb .kh-mobile-nav .kh-nav-title { color: #ffffff; }
body.kh-hebb .kh-mobile-nav .kh-nav-back,
body.kh-hebb .kh-mobile-nav .kh-nav-home {
  color: #0f3d22 !important;
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.85);
}
body.kh-hebb .kh-mobile-nav .kh-nav-back:active,
body.kh-hebb .kh-mobile-nav .kh-nav-home:active {
  background: #ffffff;
}

/* Breadcrumb */
body.kh-hebb .kh-breadcrumb {
  background: #d1e7dd;
  border-color: #a3cfbb;
}
body.kh-hebb .kh-breadcrumb a,
body.kh-hebb .kh-breadcrumb a:link { color: #0f5132; }
body.kh-hebb .kh-breadcrumb a:hover { color: #0a3622; }
body.kh-hebb .kh-breadcrumb .kh-bc-active { color: #0f5132; }

/* Sayfa basligi (.kh-pagetitle) */
body.kh-hebb table tr.kh-pagetitle th[colspan],
body.kh-hebb table tr.kh-pagetitle th {
  background: #d1e7dd !important;
  color: #0f5132 !important;
}

/* Kolon basliklari (.kh-colhead) */
body.kh-hebb table tr.kh-colhead th {
  background: #198754 !important;
  color: #ffffff !important;
  border-color: #157347 !important;
}

/* Card hover */
body.kh-hebb table tr.kh-card:hover td {
  background: rgba(25, 135, 84, 0.10) !important;
}

/* a.info kavram preview cercevesi */
body.kh-hebb a.info:hover span,
body.kh-hebb a.info:focus span {
  border-color: #198754;
}

/* TableFilter input satiri */
body.kh-hebb table tr.kh-fltrow td {
  background: #f0faf5 !important;
  border-bottom-color: #198754 !important;
}
body.kh-hebb table tr.kh-fltrow input:focus {
  border-color: #198754 !important;
  box-shadow: 0 0 0 2px rgba(25, 135, 84, 0.25) !important;
}

/* Suzgecleri sil butonu */
body.kh-hebb .reset:hover,
body.kh-hebb input.reset:hover,
body.kh-hebb input[type="button"].reset:hover {
  background: #d1e7dd !important;
  border-color: #198754 !important;
}
body.kh-hebb .reset:active,
body.kh-hebb input.reset:active,
body.kh-hebb input[type="button"].reset:active {
  background: #a3cfbb !important;
}

/* Toplam satir sayaci */
body.kh-hebb span[id^="totrows_span_"] {
  color: #0f5132 !important;
}

/* Alfa rozet (<center><a name=X><h1>X</h1>) */
body.kh-hebb td > center > a[name] > h1,
body.kh-hebb td > center > a > h1 {
  background: #198754 !important;
  color: #ffffff !important;
  border-color: #157347 !important;
}

/* p icindeki linkler yesil tema */
body.kh-hebb .kh-content p a,
body.kh-hebb .kh-content p a:link {
  color: #198754;
  font-weight: 500;
  text-decoration: none;
}
body.kh-hebb .kh-content p a:visited { color: #6f42c1; }
body.kh-hebb .kh-content p a:hover  { color: #0f5132; text-decoration: underline; }
body.kh-hebb .kh-content p a:active { color: #0a3622; }

/* Mobil (max-width:768px) */
@media (max-width: 768px) {
  body.kh-hebb table tr.kh-fltrow {
    background: #f0faf5 !important;
    border-color: #198754 !important;
    box-shadow: 0 1px 2px rgba(25, 135, 84, 0.15);
  }
  body.kh-hebb table tr.kh-card {
    border-left-color: #198754 !important;
  }
  body.kh-hebb table tr.kh-card:nth-of-type(odd) {
    background: #f5fff9 !important;
  }
}

/* ============================================================================
 * 17) p > a navigasyon linkleri + kisa-liste tablo ortalama
 *
 * Hedef: <p><a href="...">metin</a></p> formatindaki navigasyon sayfalari
 *        (guncelleme endeksi, yil listeleri vb.) kh-card td a ile ayni
 *        goruntu ve ortalamayi alsin. Kaynak HTML degismez; saf CSS.
 * ========================================================================== */

/* p icindeki linkler kh-card td a ile eslenir */
body.kh-shim .kh-content p a,
body.kh-shim .kh-content p a:link {
  color: #0d6efd;
  font-weight: 500;
  text-decoration: none;
}

body.kh-shim .kh-content p a:visited {
  color: #6f42c1;
}

body.kh-shim .kh-content p a:hover {
  color: #0a58ca;
  text-decoration: underline;
}

body.kh-shim .kh-content p a:active {
  color: #084298;
}

/* Sadece dogrudan <a> iceren <p> ogelerini ortala.
 * :has() ile uzun metin paragraflari (link icermeyen) etkilenmez.
 * Desteklenen tarayicilar: Chrome 105+, Safari 15.4+, Firefox 121+ */
body.kh-shim .kh-content p:has(> a) {
  text-align: center;
}

/* Navigasyon tablolarindaki kh-card hucrelerini ortala.
 * COL ALIGN=CENTER deprecated; modern tarayicilar bunu gormezden gelir.
 * Iki model desteklenir:
 *   a) table[align] : tabloda HTML ALIGN attribute (bazi ust-dizin sayfalar)
 *   b) table:has(col[align]) : COL ALIGN attribute olan tablolar (alt-dizinler)
 * Normal cok-sutunlu endeks tablolari ne ALIGN ne COL ALIGN kullanir -> etkilenmez.
 * :has() destegi: Chrome 105+, Safari 15.4+, Firefox 121+ */
body.kh-shim .kh-content table[align] tr.kh-card td,
body.kh-shim .kh-content table:has(col[align]) tr.kh-card td {
  text-align: center !important;
}

/* RG fihrist gun sayfalarinda <center><TABLE BORDER=0> pattern:
 * <center> yalnizca tabloyu sayfada ortalar; hucre icini hizalamaz.
 * Bu kural hucre icerigini de ortalar. BORDER=0 oldugu icin kh-card
 * islenmemistir; dogrudan tr td hedeflenir. */
body.kh-shim .kh-content center > table tr td {
  text-align: center !important;
}
