/* app-shell — sidebar + topbar + content.
   Digər app section-ları bunun .app-shell__main içinə yerləşir. */

.app-shell {
  display: flex;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
}

/* --- Sidebar (masaüstü sabit, mobil çekmecə) */
.app-shell__sidebar {
  width: 15.5rem;
  flex: none;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  display: none;
  flex-direction: column;
  padding: var(--space-4) var(--space-3);
}

.app-shell__brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  margin-bottom: var(--space-4);
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--size-md);
}

.app-shell__mark {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--on-primary);
  display: grid;
  place-items: center;
  font-size: var(--size-sm);
  font-weight: var(--weight-bold);
  flex: none;
}

.app-shell__nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-0-5);
}

.app-shell__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  transition: background var(--duration-fast) var(--ease-out-quart),
              color var(--duration-fast) var(--ease-out-quart);
}

.app-shell__link .icon { width: 1.125rem; height: 1.125rem; flex: none; }

.app-shell__link:hover {
  background: var(--hover-veil);
  color: var(--text);
}

.app-shell__link--active {
  background: var(--primary-subtle);
  color: var(--primary);
}

.app-shell__link--active:hover { background: var(--primary-subtle); }

.app-shell__nav-footer { margin-top: auto; }

.app-shell__user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-md);
}

.app-shell__avatar {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-full);
  background: var(--accent-subtle);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: var(--size-xs);
  font-weight: var(--weight-semibold);
  flex: none;
}

.app-shell__user-meta { min-width: 0; }
.app-shell__user-name {
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-shell__user-role {
  font-size: var(--size-2xs);
  color: var(--text-subtle);
}

/* --- Sağ sütun: topbar + main */
.app-shell__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-shell__topbar {
  height: 3.5rem;
  flex: none;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-4);
}

.app-shell__mobile-toggle {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-md);
  color: var(--text);
  cursor: pointer;
  flex: none;
}
.app-shell__mobile-toggle::-webkit-details-marker { display: none; }
.app-shell__mobile-toggle:hover { background: var(--hover-veil); }
.app-shell__mobile-toggle .icon { width: 1.25rem; height: 1.25rem; }

.app-shell__search {
  flex: 1;
  max-width: 24rem;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text-muted);
  font-size: var(--size-sm);
}
.app-shell__search .icon { width: 1rem; height: 1rem; flex: none; }

.app-shell__topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.app-shell__icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out-quart);
}
.app-shell__icon-btn:hover { background: var(--hover-veil); color: var(--text); }
.app-shell__icon-btn .icon { width: 1.125rem; height: 1.125rem; }

.app-shell__badge {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: var(--radius-full);
  background: var(--danger);
}

.app-shell__main {
  flex: 1;
  min-width: 0;
  overflow: auto;
  padding: var(--space-6);
}

/* Mobil naviqasiya paneli (native <details>) */
.app-shell__mobile-nav[open] .app-shell__mobile-panel {
  position: fixed;
  inset: 3.5rem 0 0 0;
  z-index: var(--z-modal);
  background: var(--surface-2);
  padding: var(--space-4) var(--space-3);
  overflow: auto;
}

@media (min-width: 64rem) {
  .app-shell__sidebar { display: flex; }
  .app-shell__mobile-toggle { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .app-shell__link,
  .app-shell__icon-btn { transition: none; }
}
