.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "topbar topbar"
    "nav content";
  gap: 18px;
  padding: 18px;
  animation: dashboard-enter 0.6s ease-out;
}

.topbar {
  grid-area: topbar;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(135deg, var(--chrome), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.brand {
  display: grid;
  gap: 4px;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.brand-sub {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav {
  grid-area: nav;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(18px);
}

.nav-group {
  margin-bottom: 18px;
  display: grid;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.nav-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.nav-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--muted);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 10px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease,
    transform 160ms ease;
}

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

.nav-item::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 50%;
  width: 4px;
  height: 60%;
  border-radius: 999px;
  transform: translateY(-50%);
  background: transparent;
}

.nav-item.active {
  color: var(--text);
  border-color: rgba(245, 159, 74, 0.45);
  background: rgba(245, 159, 74, 0.16);
  transform: translateX(2px);
}

.nav-item.active::before {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(245, 159, 74, 0.4);
}

.content {
  grid-area: content;
  padding: 8px 6px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.content-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 6px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.6px;
}

.page-sub {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.4px;
}

.page-meta {
  display: flex;
  gap: 10px;
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

.stat-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.note-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.stack {
  display: grid;
  gap: 14px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "topbar"
      "nav"
      "content";
    padding: 12px;
  }

  .nav {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    border-right: none;
    padding: 12px;
  }

  .nav-group {
    grid-auto-flow: column;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    border-bottom: none;
    padding-bottom: 0;
  }

  .grid-cols-2,
  .grid-cols-3 {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .topbar-status {
    width: 100%;
    flex-wrap: wrap;
  }

  .table-head,
  .table-row {
    grid-template-columns: 1fr;
  }

  .list-item {
    grid-template-columns: 1fr;
  }
}
