/* Каркас панели: постоянная навигация и рабочая область. */

#app {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100dvh;
}

aside {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  height: 100dvh;
  padding: 20px 13px 14px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 1px 10px 22px;
  font-size: 18px;
  font-weight: 720;
  letter-spacing: -.035em;
}
.brand .dot {
  position: relative;
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  border-radius: 8px;
  background: var(--accent);
}
.brand .dot::before, .brand .dot::after {
  position: absolute;
  bottom: 5px;
  content: "";
  width: 4px;
  border-radius: 2px;
  background: #fff;
  transform: skewY(-28deg);
}
.brand .dot::before { left: 7px; height: 13px; }
.brand .dot::after { right: 7px; height: 9px; opacity: .72; }

aside nav { display: flex; flex-direction: column; gap: 4px; }
aside nav a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 39px;
  padding: 8px 11px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-weight: 560;
  text-decoration: none;
  transition: background-color .16s ease, color .16s ease;
}
aside nav a:hover { background: var(--surface-2); color: var(--ink); }
aside nav a.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; }
aside nav a.active::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  content: "";
}

aside nav .badge {
  min-width: 20px;
  padding: 0 7px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-on);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
aside nav a.active .badge { background: var(--accent-ink); }

aside .spacer { flex: 1; }
aside .foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 10px 4px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
aside .foot button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
}

main {
  width: min(100%, 1560px);
  min-width: 0;
  margin: 0 auto;
  padding: 34px clamp(22px, 3.3vw, 50px) 72px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.page-heading .sub { margin-bottom: 0; padding-top: 1px; }
.page-heading > div:first-child { min-width: 0; }
.page-heading > .wrap { align-items: center; }

.row { display: flex; gap: 12px; align-items: flex-start; }
.row.between { justify-content: space-between; align-items: center; }
.row.center { align-items: center; }
.wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }

#login { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px; }
#login .box { width: min(100%, 360px); }

@media (max-width: 860px) {
  #app { grid-template-columns: 1fr; }
  aside {
    position: sticky;
    top: 0;
    z-index: 20;
    height: auto;
    min-width: 0;
    gap: 4px;
    padding: 10px 14px 9px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 3px 12px rgba(22, 33, 31, .04);
  }
  .brand { padding: 0 6px 8px; font-size: 16px; }
  .brand .dot { flex-basis: 22px; width: 22px; height: 22px; }
  aside nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  aside nav::-webkit-scrollbar { display: none; }
  aside nav a { flex: 0 0 auto; min-height: 36px; padding: 7px 10px; }
  aside nav a.active::before { display: none; }
  aside .spacer, aside .foot { display: none; }
  main { padding: 26px 18px 52px; }
}

@media (max-width: 600px) {
  main { padding: 22px 14px 42px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 16px; margin-bottom: 22px; }
  .page-heading > .wrap { width: 100%; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
}
