/* ═══════════════════════════════════════════════════════════════
   TUR26 — HEADER KOMPAKT (Sıkı 2 Satır) + Gear Ayar Menüsü
   24 Nisan 2026

   Kullanıcı tercihleri:
     1) Sıkı 2 satır — iki satır arası boşluk sıfıra yakın, tek bant hissi
     2) Kullanıcı badge yalnız ilk isim (JS tarafı yapar)
     3) "Referansa Al" + "Tarayıcı %X dengelendi" → ⚙️ altında popup

   TUR25 ile uyumlu, sadece sıkıştırma + gear stilleri ekliyor.
   ═══════════════════════════════════════════════════════════════ */

/* 1) SIKI 2 SATIR — dikey boşlukları neredeyse sıfırla */
header.hdr {
  padding-top: 1px !important;
  padding-bottom: 1px !important;
  row-gap: 0 !important;
}
.hdr-right {
  row-gap: 1px !important;
}
#qtr-session-bar {
  row-gap: 1px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
#qtr-session-actions {
  row-gap: 1px !important;
}

/* 2) Brand ("BK ŞANTİYE ERP v4") — dikey olarak bant ortasında dursun */
.qtr-session-brand {
  align-self: center;
}

/* 3) Kullanıcı badge'indeki "Aktif Kullanıcı" label'i dar ekranda
      zaten gizleniyordu (TUR25 ≤900px), sıkı layout'ta biraz daha
      erken gizle (yer tasarrufu) */
@media (max-width: 1200px) {
  .qtr-current-user-label { display: none !important; }
}

/* 4) Kullanıcı value metni — artık yalnızca ilk isim olacak
      (JS kısaltıyor). Max-width biraz daraldı çünkü kısa metin. */
.qtr-current-user-value {
  max-width: clamp(60px, 9vw, 140px) !important;
}

/* ═══════════════════════════════════════════════════════════════
   ⚙️ GEAR AYAR MENÜSÜ — TUR26
   ═══════════════════════════════════════════════════════════════ */

/* Orijinal .qtr-scale-hud-btn ve .qtr-scale-hud-warn elementleri
   JS tarafından .tur26-gear-pop içine TAŞINIYOR (clone değil),
   orijinal tıklama davranışları korunur. */

.tur26-gear-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.tur26-gear-btn {
  background: #f5f8fb;
  border: 1px solid #d8e2ee;
  border-radius: 999px;
  width: clamp(26px, 2.4vw, 32px);
  height: clamp(22px, 2vw, 26px);
  font-size: clamp(12px, 1vw, 15px);
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #617387;
  transition: transform .25s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
  user-select: none;
}
.tur26-gear-btn:hover {
  background: #edf3fa;
  border-color: #c6d3e2;
  transform: rotate(35deg);
}
.tur26-gear-wrap.is-open .tur26-gear-btn {
  background: #e1edf9;
  border-color: #a8c0da;
  transform: rotate(90deg);
  box-shadow: 0 2px 8px rgba(15,23,42,.08);
}

/* Popup — gear'ın altında açılan dropdown */
.tur26-gear-pop {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border: 1px solid #d8e2ee;
  border-radius: 10px;
  padding: 8px;
  gap: 6px;
  flex-direction: column;
  min-width: 200px;
  max-width: 320px;
  box-shadow: 0 12px 28px rgba(15,23,42,.14);
  z-index: 500;
  align-items: stretch;
}
.tur26-gear-wrap.is-open .tur26-gear-pop {
  display: flex;
}

/* Popup içindeki orijinal elementler — tam genişlik, hizalı */
.tur26-gear-pop > * {
  display: flex !important;
  align-self: stretch;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  margin: 0 !important;   /* orijinal margin-left:auto'yu iptal et */
}
.tur26-gear-pop .qtr-scale-hud-btn {
  padding: 8px 14px !important;
  font-size: 12px !important;
  border-radius: 8px !important;
  justify-content: center !important;
}
.tur26-gear-pop .qtr-scale-hud-warn {
  padding: 6px 10px !important;
  font-size: 11px !important;
  line-height: 1.35 !important;
  white-space: normal !important;  /* popup'ta satırlara bölünebilsin */
  text-align: center;
  justify-content: center !important;
}

/* Popup boşsa açılmasın (warn empty, btn yoksa) */
.tur26-gear-pop:empty {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   TUR28 — SESSION-BAR LAYOUT YAMASI
   24 Nisan 2026

   Sorun: 01-025-qutrit-ekran-ayarlari.js modülü şunu enjekte ediyor:
     #qtr-session-bar { justify-content: flex-end; flex-wrap: wrap }
     #qtr-session-scale-slot { flex: 1 1 auto }
     @media(max-width:1100px) #qtr-session-scale-slot { flex-basis: 100% }

   Sonuç: dar ekranda slot 100% genişlik alıp diğerlerini alt satıra
   fırlatıyor, üstelik justify-content:flex-end yüzünden BK ŞANTİYE
   brand'i de sağa itiyor. 3 satır karışık görüntü oluşuyor.

   Çözüm: Layout'u space-between'e çevir, slot'un 100% dayatmasını iptal et.
   Beklenen: [BK ŞANTİYE] ...boşluk... [pills+⚙️] [Kullanıcı/Çıkış/Badge]
   Dar ekranda bile brand hep solda, actions hep sağda; ortadaki slot
   boşluk varken genişler, yoksa hafifçe alt satıra kayar.
   ═══════════════════════════════════════════════════════════════ */

#qtr-session-bar {
  justify-content: space-between !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: clamp(4px, 0.6vw, 10px) !important;
  row-gap: 2px !important;
  padding-left: 0 !important;   /* 01-025'in 8px sol padding'ini iptal */
}

/* Brand — her zaman SOLDA, hiç shrink etmez */
#qtr-session-brand {
  flex: 0 0 auto !important;
  order: 0 !important;
  margin-right: auto;  /* brand solda tutunsun diye yardımcı itici */
}

/* Scale slot (pills + gear) — orta/sağ, 100% dayatma iptal */
#qtr-session-scale-slot {
  flex: 0 1 auto !important;      /* grow YOK, shrink VAR */
  flex-basis: auto !important;    /* 01-025'in 100%'ünü bastır */
  order: 1 !important;
  justify-content: flex-end !important;
  min-width: 0 !important;
  margin: 0 !important;
}

/* 01-025'in @media (max-width:1100px) #qtr-session-scale-slot{flex-basis:100%}
   kuralını aynı breakpoint'te override ediyoruz */
@media (max-width: 1100px) {
  #qtr-session-scale-slot {
    flex-basis: auto !important;
  }
  .qtr-scale-hud.qtr-scale-hud-inline {
    flex-basis: auto !important;
    justify-content: flex-end !important;
  }
  .qtr-scale-hud.qtr-scale-hud-inline .qtr-scale-hud-pills {
    justify-content: flex-end !important;
  }
}

/* Actions (Kullanıcı Değiştir / Çıkış / badge) — her zaman SAĞDA */
#qtr-session-actions {
  flex: 0 0 auto !important;
  order: 2 !important;
  margin-left: 0 !important;
  justify-content: flex-end !important;
}

/* .qtr-scale-hud-inline'ı da aynı şekilde davran — dış modül aynı sınıfta
   farklı kurallar enjekte ediyor */
.qtr-scale-hud.qtr-scale-hud-inline {
  flex: 0 1 auto !important;
  flex-basis: auto !important;
  min-width: 0 !important;
}
