/* ── Shell / topbar ────────────────────────────────────────────────────── */
.panel-screen {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 66px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 10, 15, 0.82);
  backdrop-filter: blur(14px);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 190px;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.topbar-sub {
  margin-left: 8px;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 500;
}

.topbar-scope {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.select {
  min-height: 36px;
  padding: 6px 34px 6px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background-color: var(--panel-2);
  color: var(--text);
  outline: none;
}

.tenant-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
}

.scope-warning {
  color: var(--muted-2);
  font-size: 12px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.user-email {
  max-width: 210px;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-badge {
  display: inline-flex;
  padding: 2px 8px;
  border: 1px solid rgba(76, 141, 255, 0.32);
  border-radius: 999px;
  background: var(--accent-soft);
  color: #a9c7ff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.role-badge[data-role='moderator'] {
  border-color: rgba(240, 180, 41, 0.35);
  background: rgba(240, 180, 41, 0.1);
  color: #ffd977;
}

/* ── Layout ────────────────────────────────────────────────────────────── */
.panel-body {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: calc(100vh - 66px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px 14px;
  border-right: 1px solid var(--border);
  background: rgba(13, 17, 24, 0.55);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 120ms ease;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.nav-item.active {
  border-color: rgba(76, 141, 255, 0.28);
  background: var(--accent-soft);
  color: #c9dcff;
}

.nav-icon {
  width: 18px;
  color: var(--muted-2);
  text-align: center;
}

.nav-item.active .nav-icon {
  color: var(--accent);
}

/* "Chat Yonetimi" nav group (nav-groups.js): a heading button that opens and
   closes a list of ordinary nav items.  The toggle is never a .nav-item. */
.nav-group,
.nav-group > [role='group'] {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition:
    background 120ms ease,
    color 120ms ease;
}

.nav-group-toggle:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.nav-group-label {
  flex: 1 1 auto;
  min-width: 0;
}

.nav-group-chevron {
  flex: 0 0 auto;
  color: var(--muted-2);
  transition: transform 120ms ease;
}

.nav-group-toggle[aria-expanded='false'] .nav-group-chevron {
  transform: rotate(-90deg);
}

/* Collapsed group holding the current page: the toggle stands in for the
   hidden active item (nav-groups.js syncActiveGroups). */
.nav-group.has-active > .nav-group-toggle {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
  color: var(--ink);
}

.nav-group.has-active > .nav-group-toggle .nav-icon,
.nav-group.has-active > .nav-group-toggle .nav-group-chevron {
  color: var(--accent);
}

.nav-group > [role='group'] {
  margin-left: 12px;
  padding-left: 6px;
  border-left: 1px solid var(--line);
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
  padding: 16px 12px 4px;
  border-top: 1px solid var(--border);
}

.content {
  min-width: 0;
  padding: 30px clamp(20px, 4vw, 44px) 56px;
}

.section {
  display: none;
  animation: section-in 160ms ease;
}

.section.active {
  display: block;
}

@keyframes section-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 30px);
  letter-spacing: -0.02em;
}
