.page-shell {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: 250px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: #f8f1dc;
  position: sticky;
  top: 0.75rem;
  height: calc(100vh - 1.5rem);
  margin: 0.75rem 0.75rem 0.75rem 0.75rem;
  box-shadow: 0 10px 22px rgba(103, 86, 49, 0.12);
  overflow: hidden;
}

.sidebar-inner {
  padding: 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  width: 100%;
  padding-bottom: 0.62rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}

.sidebar-brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.sidebar-brand-text {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.2;
}

.sidebar-brand-text strong {
  font-size: 1rem;
  font-weight: 800;
}

.sidebar-brand-text small {
  font-size: 0.78rem;
  color: var(--muted);
}

.sidebar-nav {
  display: grid;
  gap: 0.45rem;
}

.sidebar-link {
  appearance: none;
  width: 100%;
  text-align: left;
  font: inherit;
  background: transparent;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.5rem 0.58rem;
  text-decoration: none;
  color: #5a4d33;
  font-size: 0.88rem;
  font-weight: 700;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.sidebar-link:hover {
  background: #f3e7c4;
  border-color: #e4cc8b;
  color: #3d3424;
}

.sidebar-link:focus-visible {
  outline: 2px solid #dcc27d;
  outline-offset: 1px;
}

.sidebar-link[aria-current="page"] {
  background: #f3e7c4;
  border-color: #e4cc8b;
  color: #3d3424;
}

.page-main {
  min-width: 0;
  flex: 1;
}

.container {
  width: calc(100% - 2rem);
  margin: 0 auto;
}

.module-main {
  padding: 1rem 0 1.6rem;
}

.module-host {
  min-height: calc(100vh - 2.6rem);
}

.topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand-text {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 1.08rem;
  font-weight: 800;
}

.brand-text small {
  color: var(--muted);
  font-size: 0.82rem;
}

.anchor-only {
  height: 0;
  overflow: hidden;
}

@media (max-width: 1020px) {
  .sidebar {
    width: 225px;
  }
}

@media (max-width: 900px) {
  .page-shell {
    display: block;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border: 1px solid var(--border);
    border-radius: 16px;
    margin: 0.6rem 0.6rem 0;
    box-shadow: 0 6px 14px rgba(103, 86, 49, 0.08);
  }

  .sidebar-inner {
    padding: 0.8rem 1rem;
  }

  .sidebar-nav {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    padding-bottom: 0.12rem;
  }

  .sidebar-link {
    white-space: nowrap;
  }
}

@media (max-width: 760px) {
  .topbar {
    min-height: auto;
    padding-top: 0.8rem;
  }

  .container {
    width: calc(100% - 1.2rem);
  }
}

