.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 241, 231, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(230, 220, 205, 0.8);
}

.nav {
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 950;
  letter-spacing: -0.04em;
  color: var(--primary);
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: var(--shadow);
}

.brand-logo {
  width: 124px;
  height: auto;
  display: block;
}

.sidebar .brand-logo {
  width: 140px;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.12));
}

.brand span {
  display: block;
  line-height: 1;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.18em;
  margin-top: 4px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  background: var(--bg);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  background: var(--primary-dark);
  color: white;
  overflow-y: auto;
}

.sidebar .brand {
  color: white;
  margin-bottom: 28px;
}

.sidebar .brand small {
  color: rgba(255,255,255,.65);
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.sidebar-btn {
  border: 0;
  width: 100%;
  text-align: left;
  border-radius: 14px;
  padding: 13px 14px;
  color: rgba(255,255,255,.75);
  background: transparent;
  font-weight: 800;
}

.sidebar-btn:hover,
.sidebar-btn.active {
  color: white;
  background: rgba(255,255,255,.12);
}

.sidebar-footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.14);
}

.main {
  padding: 26px;
  min-width: 0;
}

.main-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.main-title {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: -0.04em;
  color: var(--primary-dark);
}

.main-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.view-root {
  display: grid;
  gap: 22px;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .main {
    padding: 18px;
  }

  .nav {
    height: auto;
    padding: 16px 0;
    flex-wrap: wrap;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
    overflow-x: auto;
  }
}
