/* Terazi — uygulama kabugu: yerlesim, sol menu, ust bant, icerik alani
 *
 * Gorsel yon (2026-09-14): giris ekraninin dili iceri tasindi.
 *   · Sol menu her temada koyu "murekkep" zemin; tonu temanin vurgusundan
 *     turer (koyu/acik → lacivert, nane → yesil, bugday → kahve). Uygulamanin
 *     kimligi burada durur. Is ekranlari (icerik) temanin kendi yuzeyinde,
 *     okunakli ve sade kalir — acik temalarda koyu menu + acik icerik bilincli.
 *   · Masaustunde menu sayfa kayarken yerinde durur; ust bant da oyle, arkasi buzlu.
 *   · Aktif menu ogesi: vurgu tonlu zemin + terazi renginde isikli kenar cizgisi.
 *   · Sayfa basligindaki nokta, "terazi" yazisindaki isikli i noktasinin yankisi.
 *   · Hareket kisa ve anlamli: sekme degisince icerik hafifce yukselir.
 *
 * Renk/olcek belirtecleri 01-token.css'ten (uretilir, elle duzenlenmez).
 * Asagidaki tureyen degiskenler o belirteclerden hesaplanir; giris ekrani da
 * (05-sayfa.css) ayni degiskenleri kullanir.
 */

:root {
  --murekkep: color-mix(in oklab, var(--accent-fill) 20%, #05060a);
  --terazi: color-mix(in oklab, var(--accent) 45%, #ffffff);
  --sahne-yazi: #eef1f6;
  --sahne-soluk: rgba(238, 241, 246, .66);
  --sahne-cizgi: rgba(255, 255, 255, .08);
  /* Koyu sahnede durum renkleri (tema --green/--red'i acik temalarda koyu ve
     murekkep zeminde okunmuyor) — yalniz ikon + etiketle birlikte kullanilir. */
  --sahne-iyi: #5fd49a;
  --sahne-kotu: #ff8a8f;
  --sahne-uyari: #f2c14e;
  --yay: cubic-bezier(.34, 1.56, .64, 1);
  /* kart golgesi: yakin ince kenar + uzak yumusak dusus */
  --golge-kart: 0 1px 2px rgba(0, 0, 0, .16), 0 14px 34px -22px rgba(0, 0, 0, .55);
  --golge-kart-ust: 0 2px 4px rgba(0, 0, 0, .18), 0 22px 48px -24px rgba(0, 0, 0, .65);
}

/* ─────────────────────────────────────────────── genel iskelet */
.app-root {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  position: relative;
}

.main-wrap {
  order: 1;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  /* Yalniz en ustte, cok hafif vurgu tonu — yogun tablolarin arkasinda gurultu yapmaz. */
  background:
    radial-gradient(900px 360px at 85% -160px, color-mix(in oklab, var(--accent) 9%, transparent), transparent 70%),
    var(--bg);
}

.main-content {
  flex: 1;
  padding: var(--sp-5);
  overflow-x: auto;
}

.content {
  max-width: var(--icerik-max);
  margin: 0 auto;
  display: none;
}
/* backwards: animasyon bitince transform kalmaz — icerideki position:fixed
   ogeler (satir menuleri vb.) icin kapsayici blok olusmasin. */
.content.active { display: block; animation: icerikGiris .32s var(--ease) backwards; }
@keyframes icerikGiris { from { opacity: 0; transform: translateY(6px); } }

/* ─────────────────────────────────────────────── sol menu */
.sidebar {
  order: 0;
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  position: relative;
  z-index: 100;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  color: var(--sahne-yazi);
  background:
    radial-gradient(130% 38% at 0% 0%, color-mix(in oklab, var(--accent) 22%, transparent), transparent 72%),
    var(--murekkep);
  border-right: 1px solid rgba(0, 0, 0, .35);
  transform: none;
  left: auto;
}
/* nokta izgara — giris sahnesinin olcek kagidi, yalniz ustte */
.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .07) 1px, transparent 1.4px);
  background-size: 20px 20px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 320px);
          mask-image: linear-gradient(180deg, #000, transparent 320px);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: color-mix(in oklab, var(--murekkep) 60%, transparent);
  -webkit-backdrop-filter: blur(3px);
          backdrop-filter: blur(3px);
  z-index: 95;
}
.sidebar-backdrop.show { display: block; }

/* ── marka ── */
.sidebar-brand {
  padding: var(--sp-5) var(--sp-4) var(--sp-4);
  border-bottom: 1px solid var(--sahne-cizgi);
  text-align: left;
}

.logo-area {
  display: flex;
  flex-direction: row;
  gap: var(--sp-3);
  align-items: center;
}
/* Yuklenmis firma logosu genis olabilir — o durumda alt alta. */
.logo-area.has-logo { flex-direction: column; align-items: flex-start; }

.logo-img {
  max-height: 120px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  display: none;
  border-radius: var(--r-md);
}
.logo-img.show { display: block; }
/* Koyu menude koyu renkli bir logo kaybolmasin: acik bir plaka uzerinde durur. */
.logo-area.has-logo .logo-img.show { background: #fff; padding: var(--sp-2); }
.logo-area.has-logo .logo-sub { display: none; }

.sidebar-brand .terazi-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--terazi);
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--sahne-cizgi);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.sidebar-brand .terazi-logo svg { width: 28px; height: 28px; }
/* Logo SVG'sindeki sabit mavi degrade her temada terazi rengine doner. */
.sidebar-brand .terazi-logo [stroke^="url"] { stroke: currentColor; }

.logo-text,
.sidebar-brand .brand-wm {
  display: inline-block;
  font-family: var(--font);
  font-size: 25px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.045em;
  color: var(--sahne-yazi);
  text-align: left;
  text-shadow: none;
}
/* noktali i — giris ekranindakiyle ayni oranlar (em), taban cizgisine oturur */
.sidebar-brand .brand-wm .bi { position: relative; display: inline-block; width: .3em; height: .8em; margin-left: .04em; }
.sidebar-brand .brand-wm .bi::before {
  content: '';
  position: absolute;
  left: .075em;
  bottom: 0;
  width: .15em;
  height: .54em;
  border-radius: .08em;
  background: currentColor;
}
.sidebar-brand .brand-wm .bi::after {
  content: '';
  position: absolute;
  left: .045em;
  top: 0;
  width: .21em;
  height: .21em;
  border-radius: 50%;
  background: var(--terazi);
  box-shadow: 0 0 .45em color-mix(in oklab, var(--terazi) 70%, transparent);
}

.logo-sub {
  margin-top: 5px;
  font-size: var(--fs-micro);
  color: var(--sahne-soluk);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 700;
  opacity: 1;
}
/* Satir ici color:var(--muted) yaziyor; acik temalarda --muted koyu gri ve
   koyu menude okunmuyordu. */
#panelUserLine { color: var(--sahne-soluk) !important; }

/* ── gezinme ── */
.sidebar-nav {
  padding: var(--sp-3) var(--sp-2) var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: rgba(255, 255, 255, .18) transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-color: transparent; }

/* Metin renkleri koyu murekkep zeminde olculdu (2026-09-14, oklab karisimi
   birebir hesaplandi; dort temanin en dusugu): --sahne-soluk 7.43:1,
   grup basligi (.5 opaklik) 4.77:1, --terazi 8.80:1, aktif ogede beyaz
   10.38:1, aktif ogede terazi renkli ikon 6.64:1. Hepsi WCAG AA ustunde.
   Opakliklari dusurmeden once yeniden olc — grup basligi esige yakin. */
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  text-align: left;
  padding: 8px var(--sp-3);
  background: transparent;
  color: var(--sahne-soluk);
  font-size: var(--fs-base);
  font-weight: 500;
  cursor: pointer;
  border: none;
  border-radius: var(--r-md);
  transition: background-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}

.nav-item:hover {
  background: rgba(255, 255, 255, .07);
  color: var(--sahne-yazi);
}
.nav-item:hover .nav-ico { color: var(--terazi); opacity: 1; }

.nav-item.active,
.nav-direct-link.active {
  background: linear-gradient(90deg, color-mix(in oklab, var(--accent) 32%, transparent), color-mix(in oklab, var(--accent) 8%, transparent));
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--terazi) 18%, transparent);
}
/* isikli kenar: menunun sol kenarina yapisik, terazi renginde */
.nav-item.active::before,
.nav-direct-link.active::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--sp-2));
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--terazi);
  box-shadow: 0 0 12px color-mix(in oklab, var(--terazi) 80%, transparent);
}

.nav-ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: inherit;
  display: block;
  opacity: .85;
}
.nav-item.active .nav-ico,
.nav-direct-link.active .nav-ico { color: var(--terazi); opacity: 1; }

.nav-group {
  display: flex;
  flex-direction: column;
  margin-top: var(--sp-2);
}

.nav-group-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  text-align: left;
  padding: var(--sp-2) var(--sp-3);
  border: none;
  border-radius: var(--r-md);
  background: transparent;
  color: rgba(238, 241, 246, .5);
  font-size: var(--fs-micro);
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: var(--ls-baslik);
  transition: background-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}

.nav-group-header:hover { background: rgba(255, 255, 255, .06); color: var(--sahne-yazi); }
.nav-group-header:hover .nav-ico { color: var(--terazi); opacity: 1; }
.nav-group.has-active .nav-group-header { color: var(--terazi); }

/* Aktif oge de hover'a tepki versin (ozgulluk: aktif kural kendi zeminini yaziyor). */
.nav-item.active:hover,
.nav-direct-link.active:hover {
  background: linear-gradient(90deg, color-mix(in oklab, var(--accent) 40%, transparent), color-mix(in oklab, var(--accent) 12%, transparent));
  color: #fff;
}
.nav-group.has-active .nav-group-header:hover { background: rgba(255, 255, 255, .06); color: var(--terazi); }

.nav-group-header .nav-caret {
  margin-left: auto;
  transition: transform var(--dur) var(--ease);
  font-size: 9px;
  opacity: .6;
}
.nav-group.open .nav-group-header .nav-caret { transform: rotate(90deg); }

.nav-group-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--dur-slow) var(--ease);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-group.open .nav-group-items { max-height: 640px; }

/* Alt ogeler girintili ve bir kademe kucuk — derinlik tipografiyle anlatilir. */
.nav-group-items .nav-item {
  padding-left: 38px;
  font-size: var(--fs-sm);
}

/* ─────────────────────────────────────────────── ust bant */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  padding: var(--sp-3) var(--sp-6);
  min-height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
          backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in oklab, var(--border) 75%, transparent);
}
.topbar::before { content: none; }

/* Sayfa basligi: olcek + agirlikla; oncesindeki isikli nokta marka yankisi. */
.topbar-title {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-xl);
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-strong);
  letter-spacing: -.025em;
  text-shadow: none;
}
.topbar-title::before {
  content: '';
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 18%, transparent);
}

.topbar-meta {
  color: var(--muted);
  font-size: var(--fs-sm);
  text-align: right;
  line-height: var(--lh);
}

.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 11px;
  left: var(--sp-2);
  z-index: 120;
  width: 42px;
  height: 42px;
  border: 1px solid var(--sahne-cizgi);
  border-radius: var(--r-md);
  background: var(--murekkep);
  color: var(--sahne-yazi);
  cursor: pointer;
  box-shadow: var(--golge-kart);
  font-size: 19px;
  line-height: 1;
}

/* ─────────────────────────────────────────────── duyarli
 * Dar ekranda sol menu cekmece; genis ekranda solda, sayfa kayarken yerinde. */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(288px, 88vw);
    min-width: min(288px, 88vw);
    flex: 0 0 auto;
    z-index: 110;
    transform: translateX(-105%);
    transition: transform var(--dur-slow) var(--ease);
    box-shadow: var(--e3);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .main-wrap { width: 100%; max-width: 100%; }
  .topbar { padding-left: 62px; min-height: 64px; }
  .topbar-title { font-size: var(--fs-lg); }
  /* Ozet satiri ("Dashboard · … satis, … tahsilat") telefonda bandi uc satira yayiyordu. */
  .topbar-meta { display: none; }
  .main-content { padding: var(--sp-3); }
}

@media (min-width: 769px) {
  .sidebar {
    position: sticky !important;
    top: 0;
    height: 100vh;
    align-self: flex-start;
    transform: none !important;
    left: auto !important;
  }
  .sidebar-toggle { display: none !important; }
}

/* ─────────────────────────────────────────────── ust bant eylemleri */
.topbar-arac {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.tb-bilgi {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--muted);
  padding: 7px var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--card);
}
.tb-bilgi:empty { display: none; }

.tb-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  height: 36px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--e1);
  transition: background-color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.tb-btn:hover { background: var(--card-hover); border-color: var(--accent); transform: translateY(-1px); }
.tb-btn:active { transform: translateY(1px); }
.tb-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.tb-btn-birincil {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  color: var(--on-fill);
  box-shadow: 0 8px 20px -12px color-mix(in oklab, var(--accent-fill) 90%, transparent);
}
.tb-btn-birincil:hover { filter: brightness(1.1); background: var(--accent-fill); border-color: var(--accent-fill); }

/* Cikis yikici bir eylem: dolgu degil, kirmizi konturla uyarir. */
.tb-btn-tehlike { color: var(--red); border-color: color-mix(in oklab, var(--red) 70%, transparent); background: transparent; box-shadow: none; }
.tb-btn-tehlike:hover { background: var(--red-fill); border-color: var(--red-fill); color: var(--on-fill); }

.tb-kisayol {
  font: inherit;
  font-size: var(--fs-micro);
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 1px 5px;
  background: var(--bg);
}

/* Yenileme ikonu veri cekilirken doner. */
.tb-ikon { display: inline-block; line-height: 1; }
.tb-btn.loading .tb-ikon { animation: tbDon 900ms linear infinite; }
@keyframes tbDon { to { transform: rotate(360deg); } }
