/* ====================================================
   KAZANIM ANALİZ SİSTEMİ — Beştepe Koleji Kurumsal Tema
   ==================================================== */

:root {
  /* Kurumsal renkler (logo referans alınarak) */
  --mor-900: #2c1354;
  --mor-800: #391a6b;
  --mor-700: #452178;
  --mor-600: #52288d;
  --mor-500: #6a3fa0;
  --mor-100: #efe9f9;
  --altin: #c9a15c;
  --altin-koyu: #a9832f;
  --altin-acik: #f0dfb8;

  --renk-ana: var(--mor-700);
  --renk-ana-koyu: var(--mor-900);

  --renk-cok-iyi: #1e8e3e;
  --renk-iyi: #66bb6a;
  --renk-orta: #f9a825;
  --renk-zayif: #e53935;

  --kenar-cubugu-genislik: 268px;
  --font-baslik: 'Poppins', 'Segoe UI', sans-serif;
  --font-govde: 'Inter', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

body {
  background-color: #f5f3fa;
  font-family: var(--font-govde);
  color: #2b2438;
  margin: 0;
}

h1, h2, h3, h4, h5, h6, .fw-bold {
  font-family: var(--font-baslik);
}

a { text-decoration: none; }

/* ================= APP SHELL / LAYOUT ================= */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sayfa-icerigi {
  width: calc(100% - var(--kenar-cubugu-genislik));
  box-sizing: border-box;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin-left: var(--kenar-cubugu-genislik);
  min-height: 100vh;
}

.sayfa-icerigi main { flex: 1; }

.sayfa-altbilgi {
  text-align: center;
  color: #8a7fa0;
  font-size: .85rem;
  padding: 1rem;
  border-top: 1px solid #e7e1f2;
  background: #fff;
}

.giris-sayfasi {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--mor-900) 0%, var(--mor-700) 55%, var(--mor-500) 100%);
  padding: 2rem 1rem;
}

/* ================= SOL MENÜ (SIDEBAR) ================= */
.kenar-cubugu {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--kenar-cubugu-genislik);
  background: linear-gradient(180deg, var(--mor-900) 0%, var(--mor-700) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform .25s ease;
  box-shadow: 4px 0 24px rgba(44, 19, 84, .18);
  overflow: hidden;
}

.kenar-cubugu-marka {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: 1.4rem 1.2rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.kenar-logo {
  width: 46px; height: 46px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  padding: 5px;
  box-shadow: 0 3px 10px rgba(0,0,0,.25);
  flex-shrink: 0;
}

.marka-baslik {
  font-family: var(--font-baslik);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.15;
  color: #fff;
}

.marka-altbaslik {
  font-size: .74rem;
  color: var(--altin-acik);
  letter-spacing: .04em;
  text-transform: uppercase;
  font-weight: 600;
}

.kenar-menu {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: .9rem .8rem;
  min-width: 0;
}

.menu-grup-basligi {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.45);
  font-weight: 700;
  margin: 1.1rem .6rem .4rem;
}
.menu-grup-basligi:first-child { margin-top: .2rem; }

.menu-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .62rem .8rem;
  border-radius: 10px;
  color: rgba(255,255,255,.82);
  font-size: .92rem;
  font-weight: 500;
  margin-bottom: .18rem;
  transition: background .15s ease, color .15s ease;
}
.menu-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; opacity: .9; }

.menu-link:hover {
  background: rgba(255,255,255,.09);
  color: #fff;
}

.menu-link.aktif {
  background: linear-gradient(90deg, var(--altin) 0%, var(--altin-koyu) 100%);
  color: var(--mor-900);
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(201, 161, 92, .35);
}
.menu-link.aktif i { color: var(--mor-900); opacity: 1; }

.kenar-cubugu-kullanici {
  padding: .9rem .8rem 1.1rem;
  border-top: 1px solid rgba(255,255,255,.12);
}

.kullanici-bilgi {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .4rem .3rem .8rem;
}

.kullanici-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.kullanici-ad {
  font-size: .86rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 165px;
}

.kullanici-rol {
  font-size: .72rem;
  color: var(--altin-acik);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.cikis-link {
  color: #ffd7d7 !important;
}
.cikis-link:hover { background: rgba(229, 57, 53, .18); color: #fff !important; }

/* Önizleme şeridi */
.onizleme-seridi {
  background: linear-gradient(90deg, var(--altin) 0%, var(--altin-koyu) 100%);
  color: var(--mor-900);
  text-align: center;
  padding: .6rem 1rem;
  font-size: .9rem;
  font-weight: 600;
}
.onizleme-seridi a { color: var(--mor-900); text-decoration: underline; font-weight: 700; }

/* ================= MOBİL ÜST ÇUBUK ================= */
/* position:fixed KRİTİK: .app-shell display:flex olduğu için sticky/static kalsaydı
   bu öğe bir flex ITEM olarak davranıp tam genişlik yerine içerik genişliğine daralır
   ve konteyner yüksekliğine (100vh) gerilirdi. fixed ile flex akışından tamamen çıkarılır. */
.mobil-ustcubuk {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  box-sizing: border-box;
  z-index: 1030;
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .7rem 1rem;
  background: linear-gradient(90deg, var(--mor-900), var(--mor-700));
  color: #fff;
  box-shadow: 0 2px 10px rgba(44,19,84,.2);
}

.menu-ac-buton {
  color: #fff;
  font-size: 1.4rem;
  padding: .2rem .4rem;
  line-height: 1;
}

.mobil-marka {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #fff;
  font-weight: 700;
  font-family: var(--font-baslik);
}
.mobil-logo {
  width: 32px; height: 32px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  flex-shrink: 0;
}

.kenar-ortusu {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 8, 40, .55);
  z-index: 1035;
}
.kenar-ortusu.gorunur { display: block; }

@media (max-width: 991.98px) {
  .kenar-cubugu { transform: translateX(-100%); }
  .kenar-cubugu.acik { transform: translateX(0); }
  .sayfa-icerigi { margin-left: 0; width: 100%; padding-top: 58px; }
}

/* ================= GENEL BİLEŞENLER ================= */
.kart-giris {
  max-width: 430px;
  width: 100%;
}

.kart-panel {
  border: none;
  border-radius: 16px;
  box-shadow: 0 2px 14px rgba(44, 19, 84, .07);
  transition: transform .15s ease, box-shadow .15s ease;
}
.kart-panel:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(44, 19, 84, .12); }

.ikon-kutu {
  width: 54px; height: 54px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  font-size: 1.5rem;
  color: #fff;
  background: linear-gradient(135deg, var(--mor-700), var(--mor-500));
}

.btn-primary {
  background: linear-gradient(90deg, var(--mor-700), var(--mor-600));
  border: none;
}
.btn-primary:hover, .btn-primary:focus {
  background: linear-gradient(90deg, var(--mor-800), var(--mor-700));
}
.btn-outline-primary {
  color: var(--mor-700);
  border-color: var(--mor-700);
}
.btn-outline-primary:hover {
  background: var(--mor-700);
  border-color: var(--mor-700);
}
.btn-success { background: linear-gradient(90deg, #1e8e3e, #2fa350); border: none; }
.text-primary { color: var(--mor-700) !important; }
.badge.bg-dark { background: var(--mor-900) !important; }

a { color: var(--mor-700); }
a:hover { color: var(--mor-900); }

/* ---- Başarı seviyesi renk kodlaması ---- */
.seviye-cok-iyi { background-color: var(--renk-cok-iyi) !important; color: #fff !important; }
.seviye-iyi     { background-color: var(--renk-iyi) !important; color: #fff !important; }
.seviye-orta    { background-color: var(--renk-orta) !important; color: #212529 !important; }
.seviye-zayif   { background-color: var(--renk-zayif) !important; color: #fff !important; }
.seviye-belirsiz{ background-color: #adb5bd !important; color: #fff !important; }

.rozet-seviye {
  display: inline-block;
  padding: .35em .75em;
  border-radius: 20px;
  font-weight: 600;
  font-size: .85rem;
  min-width: 90px;
  text-align: center;
}

.hucre-seviye {
  border-radius: 8px;
  padding: .5rem;
  text-align: center;
  font-weight: 600;
  min-width: 70px;
}

.tablo-responsive-sarma {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table thead th {
  color: var(--mor-800);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  border-bottom-width: 2px;
}

@media (max-width: 576px) {
  .kart-panel .card-body { padding: 1rem; }
  .ikon-kutu { width: 44px; height: 44px; font-size: 1.2rem; }
}

/* ================= SAĞ ÜST PROFİL ÇUBUĞU ================= */
.ust-cubuk {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: .7rem 1.2rem;
  background: #fff;
  border-bottom: 1px solid #e7e1f2;
}
.ust-cubuk-bosluk { flex: 1; }

.profil-dropdown-buton {
  display: flex;
  align-items: center;
  gap: .55rem;
  background: #f5f3fa;
  border: 1px solid #e7e1f2;
  border-radius: 30px;
  padding: .35rem .9rem .35rem .35rem;
  color: var(--mor-800);
  font-weight: 600;
  font-size: .88rem;
}
.profil-dropdown-buton:hover { background: var(--mor-100); }

.profil-avatar-kucuk {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mor-700), var(--mor-500));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
}

.dropdown-header { font-weight: 700; color: var(--mor-800); font-size: .85rem; }
.dropdown-item:active, .dropdown-item.active { background: var(--mor-100); color: var(--mor-900); }

/* Popper konumlandırma taşmasını önlemek için: profil menüsü her zaman sidebar'ın önünde,
   sabit (statik) konumlu render edilir (data-bs-display="static" ile birlikte kullanılır) */
/* ÖNEMLİ: Bu z-index değerleri mobil menü (kenar-cubugu: 1040) ve karartma (kenar-ortusu: 1035)
   ile ASLA çakışmamalı — aksi halde menü açıkken bu çubuk/dropdown'ın üstünden "sızıp" görünür.
   Bu yüzden bilerek düşük tutuluyor (sadece normal sayfa içeriğinin üzerinde görünmesi yeterli). */
.ust-cubuk { position: relative; z-index: 2; }
.ust-cubuk .dropdown-menu {
  z-index: 1020;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  min-width: 220px;
}

/* ================= AÇILIR/KAPANIR ALT MENÜ GRUBU (Yönetici) ================= */
.menu-link-acilir {
  cursor: pointer;
  justify-content: flex-start;
}
.menu-ok {
  font-size: .8rem;
  transition: transform .2s ease;
}
.menu-link-acilir[aria-expanded="true"] .menu-ok {
  transform: rotate(180deg);
}

.menu-alt-grup {
  padding-left: .6rem;
  border-left: 2px solid rgba(255,255,255,.12);
  margin: .1rem 0 .3rem .95rem;
}

.menu-link-alt {
  font-size: .85rem;
  padding: .5rem .7rem;
  opacity: .92;
}
.menu-link-alt i { font-size: .95rem; }

/* ================= PWA "ANA EKRANA EKLE" BANNER ================= */
.pwa-yukleme-banner {
  position: fixed;
  left: 12px; right: 12px; bottom: 12px;
  z-index: 1090;
  background: linear-gradient(135deg, var(--mor-900), var(--mor-700));
  color: #fff;
  border-radius: 16px;
  padding: .9rem 1rem;
  box-shadow: 0 8px 28px rgba(20, 8, 40, .35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  flex-wrap: wrap;
  transform: translateY(120%);
  opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
  max-width: 480px;
  margin: 0 auto;
}
.pwa-yukleme-banner.gorunur {
  transform: translateY(0);
  opacity: 1;
}

.pwa-yukleme-icerik {
  display: flex;
  align-items: center;
  gap: .7rem;
  flex: 1;
  min-width: 200px;
}

.pwa-yukleme-logo {
  width: 40px; height: 40px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  padding: 4px;
  flex-shrink: 0;
}

.pwa-yukleme-metin {
  font-size: .86rem;
  line-height: 1.35;
}

.pwa-yukleme-butonlar {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-shrink: 0;
  margin-left: auto;
}

.pwa-yukleme-banner .btn-light {
  font-weight: 700;
  color: var(--mor-800);
}

@media (max-width: 420px) {
  .pwa-yukleme-banner { left: 8px; right: 8px; bottom: 8px; padding: .8rem; }
  .pwa-yukleme-metin { font-size: .8rem; }
}
