/* Temel stil + uygulama kabuğu (yan menü, üst bar, mobil alt gezinme) */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: var(--lh);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
img, svg, video { max-width: 100%; }
img { height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0 0 var(--s-2); line-height: 1.25; letter-spacing: -.01em; font-weight: 700; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
p { margin: 0 0 var(--s-3); }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-5) 0; }
small, .text-sm { font-size: var(--fs-sm); }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.num, .money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.strong { font-weight: 700; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
::selection { background: var(--brand-200); color: var(--n-900); }

.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.ico-sm { width: 16px; height: 16px; }
.ico-lg { width: 22px; height: 22px; }
.ico-xl { width: 32px; height: 32px; stroke-width: 1.6; }

.skip-link { position: absolute; left: var(--s-3); top: -60px; z-index: 200; background: var(--surface); padding: var(--s-2) var(--s-3); border-radius: var(--r-md); box-shadow: var(--sh-2); }
.skip-link:focus { top: var(--s-3); }

/* ---------- Kabuk ---------- */
.shell { min-height: 100vh; display: flex; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 60;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  transition: width var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.sidebar__brand { height: var(--topbar-h); display: flex; align-items: center; gap: var(--s-2); padding: 0 var(--s-5); border-bottom: 1px solid var(--line); }
.sidebar__brand img { height: 30px; width: auto; display: block; }
.sidebar__brand .logo-mark { display: none; height: 34px; width: 34px; border-radius: 9px; }
.sidebar__nav { flex: 1; overflow-y: auto; padding: var(--s-3); display: flex; flex-direction: column; gap: 2px; }
.sidebar__label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding: var(--s-4) var(--s-3) var(--s-2); }
.nav-link {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 9px var(--s-3); border-radius: var(--r-md);
  color: var(--sidebar-text); font-weight: 600; font-size: var(--fs-md);
  white-space: nowrap; position: relative;
}
.nav-link:hover { background: var(--bg-sunken); text-decoration: none; color: var(--text); }
.nav-link.is-active { background: var(--primary-soft); color: var(--primary); }
.nav-link.is-active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.nav-link .ico { width: 20px; height: 20px; }
.nav-link .nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-full); background: var(--bad-600); color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.sidebar__foot { padding: var(--s-3); border-top: 1px solid var(--line); }
.sidebar__collapse { width: 100%; justify-content: flex-start; }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); transition: margin-left var(--dur) var(--ease); display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: var(--s-3);
  padding: 0 var(--s-6);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__title { font-weight: 700; font-size: var(--fs-lg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__spacer { flex: 1; }
.topbar__menu { display: none; }
.user-chip { display: inline-flex; align-items: center; gap: var(--s-2); padding: 4px 10px 4px 4px; border-radius: var(--r-full); border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 600; font-size: var(--fs-sm); }
.user-chip:hover { text-decoration: none; border-color: var(--line-strong); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; text-transform: uppercase; }
.content { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: var(--s-6); flex: 1; }

/* Daraltılmış yan menü (masaüstü) */
html.sb-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
html.sb-collapsed .main { margin-left: var(--sidebar-w-collapsed); }
html.sb-collapsed .sidebar__brand { justify-content: center; padding: 0; }
html.sb-collapsed .sidebar__brand .logo-full { display: none; }
html.sb-collapsed .sidebar__brand .logo-mark { display: block; }
html.sb-collapsed .nav-link { justify-content: center; padding: 10px; }
html.sb-collapsed .nav-link span, html.sb-collapsed .sidebar__label, html.sb-collapsed .sidebar__collapse span { display: none; }
html.sb-collapsed .nav-link .nav-badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
html.sb-collapsed .sidebar__collapse { justify-content: center; }
html.sb-collapsed .nav-link.is-active::before { left: -12px; }

/* Sayfa başlığı: başlık + breadcrumb + ana aksiyon hep aynı yerde */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-5); }
.page-head h1 { margin: 2px 0 0; font-size: var(--fs-3xl); letter-spacing: -.02em; }
.page-head__sub { color: var(--text-2); margin: var(--s-1) 0 0; }
.page-head__actions { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-3); flex-wrap: wrap; }
.crumbs a { color: var(--text-2); }
.crumbs .ico { width: 14px; height: 14px; }

/* Mobil alt gezinme */
.bottomnav { display: none; }
.scrim { display: none; }

@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); width: min(86vw, 300px); box-shadow: var(--sh-3); }
  html.sb-collapsed .sidebar { width: min(86vw, 300px); }
  html.drawer-open .sidebar { transform: none; }
  html.sb-collapsed .sidebar__brand .logo-full, html.sb-collapsed .nav-link span, html.sb-collapsed .sidebar__label { display: initial; }
  html.sb-collapsed .sidebar__brand .logo-mark { display: none; }
  html.sb-collapsed .nav-link { justify-content: flex-start; padding: 9px var(--s-3); }
  .sidebar__collapse { display: none; }
  .main, html.sb-collapsed .main { margin-left: 0; }
  .topbar { padding: 0 var(--s-4); }
  .topbar__menu { display: inline-flex; }
  .content { padding: var(--s-4) var(--s-4) calc(var(--bottomnav-h) + var(--s-6) + env(safe-area-inset-bottom)); }
  .page-head h1 { font-size: var(--fs-2xl); }
  html.drawer-open .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(15, 14, 12, .45); }
  .bottomnav {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .04);
  }
  .bottomnav a, .bottomnav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font: inherit; font-size: 11px; font-weight: 700; color: var(--text-3);
    background: none; border: 0; padding: 6px 2px; cursor: pointer; position: relative;
  }
  .bottomnav a:hover { text-decoration: none; }
  .bottomnav .is-active { color: var(--primary); }
  .bottomnav .ico { width: 22px; height: 22px; }
  .bottomnav .nav-badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 16px; height: 16px; border-radius: 999px; background: var(--bad-600); color: #fff; font-size: 10px; padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; }
}
@media (max-width: 480px) {
  .user-chip .user-chip__name { display: none; }
  .user-chip { padding: 3px; }
}

/* Yardımcılar */
.stack { display: flex; flex-direction: column; gap: var(--s-4); }
.row { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grid { display: grid; gap: var(--s-4); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: var(--s-2); } .mt-4 { margin-top: var(--s-4); } .mt-6 { margin-top: var(--s-6); }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: var(--s-2); } .mb-4 { margin-bottom: var(--s-4); }
.w-full { width: 100%; }
.hide-mobile { } .only-mobile { display: none; }
@media (max-width: 720px) { .hide-mobile { display: none !important; } .only-mobile { display: initial; } }
