.shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
}

.shell-sidebar {
  background: var(--ink);
  color: var(--snow);
  padding: 1.25rem 0.9rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.shell-brand {
  display: block;
  color: var(--snow);
  text-decoration: none;
  padding: 0.2rem 0.45rem 0;
}

.sidebar-logo {
  width: 100%;
  height: auto;
}

.shell-brand:hover {
  text-decoration: none;
}

.shell-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.shell-nav a,
.shell-nav .shell-nav-item {
  display: block;
  padding: 0.45rem 0.7rem;
  border-radius: 6px;
  color: #c5ced9;
  text-decoration: none;
}

.shell-nav a:hover,
.shell-nav .shell-nav-item:hover {
  color: var(--snow);
  background: rgba(47, 108, 255, 0.16);
  text-decoration: none;
}

.shell-nav a.is-active {
  color: var(--snow);
  background: rgba(20, 228, 196, 0.12);
  box-shadow: inset 2px 0 0 var(--aqua);
}

.shell-sidebar-foot {
  margin-top: auto;
  padding: 0 0.7rem;
  color: var(--mist);
  font-size: 0.75rem;
}

.shell-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.shell-topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.5rem;
  background: var(--snow);
  border-bottom: 1px solid var(--line);
}

.shell-topbar-title {
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell-content {
  padding: 1.5rem;
}

.panel {
  background: var(--snow);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem;
}

.panel + .panel {
  margin-top: 1rem;
}

.panel > h2 {
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.panel > h1 + form {
  margin-top: 1rem;
}

.shell-content > h1 {
  margin-bottom: 1rem;
}

.panel {
  min-width: 0;
  overflow-wrap: anywhere;
}

.lede {
  color: var(--mist);
  max-width: 42rem;
  margin-top: 0.4rem;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-stat {
  background: var(--snow);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.home-stat strong {
  display: block;
  font-size: 1.4rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.home-stat span {
  color: var(--mist);
  font-size: 0.85rem;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 0;
  color: var(--ink);
  padding: 0.25rem;
}

.menu-close {
  display: none;
}

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

  .shell-sidebar {
    display: none;
  }

  .shell.is-nav-open .shell-sidebar {
    display: flex;
    position: fixed;
    inset: 0 auto 0 0;
    width: min(var(--sidebar), 86vw);
    z-index: 20;
    overflow-y: auto;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .menu-close {
    display: inline-flex;
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 0;
    background: var(--ink);
    color: var(--snow);
    font-size: 1.25rem;
    border-radius: 6px;
    cursor: pointer;
  }

  .home-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 601px) and (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .shell-content {
    padding: 1rem;
  }

  .shell-topbar {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
  }

  .switcher {
    flex: 1;
    min-width: 0;
  }

  .switcher select {
    width: 100%;
    min-width: 0;
  }

  .topbar-actions {
    gap: 0.5rem;
  }

  .user-chip,
  .topbar-actions > a {
    display: none;
  }

  .panel {
    padding: 1rem;
  }
}
