/* Temel stiller ve uygulama yerleşimi (üst çubuk, yan menü / mobil çekmece, içerik). */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: var(--line-height);
}

h1,
h2,
h3 {
  margin: 0 0 var(--space-3);
  line-height: 1.25;
}

h1 {
  font-size: var(--font-size-xl);
}

h2 {
  font-size: var(--font-size-lg);
}

a {
  color: var(--color-brand);
}

a:hover {
  color: var(--color-brand-strong);
}

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

[x-cloak] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.muted {
  color: var(--color-text-muted);
}

/* ---- Yerleşim ---- */

.app {
  min-height: 100vh;
}

.app__topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--topbar-height);
  padding: 0 var(--space-4);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.app__brand {
  font-weight: var(--font-weight-strong);
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app__search {
  flex: 1;
  max-width: 28rem;
  position: relative;
}

.app__topbar-end {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.app__user {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.app__body {
  display: flex;
}

.app__sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  min-height: calc(100vh - var(--topbar-height));
  padding: var(--space-4) var(--space-3);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
}

.app__main {
  flex: 1;
  min-width: 0;
  max-width: var(--content-max-width);
  padding: var(--space-5);
}

.app__menu-toggle {
  display: none;
}

.app__backdrop {
  display: none;
}

/* Mobil: yan menü çekmeceye döner. */
@media (max-width: 48rem) {
  .app__menu-toggle {
    display: inline-flex;
  }

  .app__sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    min-height: 0;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .app__sidebar--open {
    transform: none;
  }

  .app__backdrop--open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgb(0 0 0 / 40%);
  }

  .app__user {
    display: none;
  }

  .app__main {
    padding: var(--space-4) var(--space-3);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app__sidebar {
    transition: none;
  }
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.page-header h1 {
  margin: 0;
}
