/* ── application shell ─────────────────────────────────────── */
.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.3s var(--ease);
}
.shell.is-collapsed {
  grid-template-columns: 82px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 22px 14px 18px;
  background:
    radial-gradient(280px 240px at -20% 0%, rgba(255, 121, 24, 0.035), transparent 70%),
    var(--sidebar);
  border-right: 1px solid rgba(255, 255, 255, 0.035);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar {
  display: none;
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 128px;
  padding: 2px 7px;
  margin-bottom: 8px;
  border-radius: 16px;
  isolation: isolate;
}
.brand::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 8px;
  top: 16px;
  width: 118px;
  height: 98px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(132, 74, 255, 0.19), transparent 68%);
  filter: blur(16px);
  pointer-events: none;
}
.brand-logo {
  width: 122px;
  height: auto;
  flex: 0 0 auto;
  object-fit: contain;
  filter:
    drop-shadow(0 0 18px rgba(133, 74, 255, 0.18))
    drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
}

.nav-scroll {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-group + .nav-group {
  margin-top: 12px;
}
.nav-group-label {
  padding: 5px 13px 7px;
  color: #4e505a;
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 43px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #a6a8b2;
  font-size: 13.5px;
  font-weight: 540;
  letter-spacing: -0.01em;
  transition:
    color 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
}
.nav-link > .i {
  color: #747782;
  transition: color 0.16s ease;
}
.nav-link > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}
.nav-link:hover > .i {
  color: var(--text-soft);
}
.nav-link.is-active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.03));
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.nav-link.is-active > .i {
  color: var(--text);
}
.nav-link.is-active::before,
.nav-parent.has-active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 9px;
  background: var(--orange);
  box-shadow: 0 0 12px rgba(255, 122, 24, 0.6);
}
.nav-parent.has-active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.03));
  border-color: rgba(255, 255, 255, 0.08);
}
.nav-parent.has-active > .i {
  color: var(--text);
}
.nav-link.nav-event {
  margin: 4px 0;
  border-color: rgba(255, 138, 46, 0.25);
  background: linear-gradient(90deg, rgba(255, 130, 36, 0.075), rgba(255, 130, 36, 0.02));
  color: #f4d4b6;
}
.nav-link.nav-event > .i {
  color: var(--orange-soft);
}
.nav-link.nav-event:hover {
  border-color: rgba(255, 138, 46, 0.4);
  background: linear-gradient(90deg, rgba(255, 130, 36, 0.11), rgba(255, 130, 36, 0.03));
}

.nav-chevron {
  width: 15px;
  height: 15px;
  color: #5e606a;
  transition: transform 0.2s ease;
}
.nav-parent[aria-expanded="false"] .nav-chevron {
  transform: rotate(0);
}
.nav-parent[aria-expanded="true"] .nav-chevron {
  transform: rotate(180deg);
}

.subnav {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 2px 0 4px 23px;
  padding-left: 14px;
}
.subnav::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 1px;
  background: rgba(255, 255, 255, 0.075);
}
.subnav[hidden] {
  display: none;
}
.subnav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 37px;
  padding: 0 9px;
  border-radius: 8px;
  color: #7f818c;
  font-size: 13px;
  font-weight: 520;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}
.subnav-link:hover {
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.025);
}
.subnav-link.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.subnav-link.is-active::before {
  content: "";
  position: absolute;
  left: -15px;
  width: 2px;
  height: 16px;
  border-radius: 9px;
  background: var(--orange);
  box-shadow: 0 0 10px rgba(255, 122, 24, 0.55);
}
.subnav-link .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #444650;
}
.subnav-link.is-active .dot {
  background: var(--orange);
}

.sidebar-foot {
  margin-top: 12px;
  padding: 12px 10px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  color: #4c4e58;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  white-space: nowrap;
  overflow: hidden;
}
.server-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #666a74;
}
.server-state::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 7px rgba(53, 201, 163, 0.8);
}

/* collapsed sidebar */
.shell.is-collapsed .brand {
  justify-content: center;
  min-height: 74px;
  padding: 0;
}
.shell.is-collapsed .brand-logo {
  width: 62px;
}
.shell.is-collapsed .nav-group-label,
.shell.is-collapsed .nav-link > span,
.shell.is-collapsed .nav-chevron,
.shell.is-collapsed .sidebar-foot span,
.shell.is-collapsed .sidebar-foot .server-state {
  display: none;
}
.shell.is-collapsed .nav-link {
  justify-content: center;
  padding: 0;
  gap: 0;
}
.shell.is-collapsed .nav-link::after {
  content: attr(data-title);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  z-index: 200;
  transform: translateY(-50%) translateX(-4px);
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #1b1c22;
  color: var(--text);
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.shell.is-collapsed .nav-link:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
.shell.is-collapsed .subnav {
  margin-left: 0;
  padding-left: 0;
  align-items: center;
}
.shell.is-collapsed .subnav::before,
.shell.is-collapsed .subnav-link span {
  display: none;
}
.shell.is-collapsed .subnav-link {
  justify-content: center;
  width: 44px;
  height: 38px;
  padding: 0;
}
.shell.is-collapsed .subnav-link.is-active::before {
  left: -19px;
}
.shell.is-collapsed .sidebar-foot {
  justify-content: center;
  padding: 12px 0 4px;
  visibility: hidden;
}

/* ── topbar ────────────────────────────────────────────────── */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  height: 78px;
  padding: 0 26px;
  background: linear-gradient(180deg, rgba(7, 8, 10, 0.94), rgba(7, 8, 10, 0.82));
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.025);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.topbar-toggle {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0f1014;
  color: #a9abb4;
}
.topbar-toggle:hover {
  color: #fff;
  background: #17181e;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #60636d;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.breadcrumbs .crumb {
  white-space: nowrap;
}
.breadcrumbs .crumb-current {
  color: #f4f5f7;
  font-weight: 750;
}
.breadcrumbs .crumb-sep {
  color: #3e414a;
  font-weight: 500;
}
.breadcrumbs > .i {
  width: 19px;
  height: 19px;
  color: #777a85;
  margin-right: 2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}
.topbar-actions .icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
}

.account {
  position: relative;
}
.account-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  margin-left: 5px;
  padding: 4px 8px 4px 4px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #111217;
  transition:
    border-color 0.18s ease,
    background 0.18s ease;
}
.account-btn:hover {
  border-color: var(--line-strong);
  background: #17181e;
}
.account-btn .avatar {
  width: 32px;
  height: 32px;
  font-size: 10px;
}
.account-btn .i {
  width: 15px;
  height: 15px;
  color: var(--muted);
}
.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 262px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: #16171c;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  animation: modal-in 0.22s var(--ease) both;
  transform-origin: top right;
}
.account-menu[hidden] {
  display: none;
}
.account-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
}
.account-head .avatar {
  width: 40px;
  height: 40px;
}
.account-head strong {
  display: block;
  font-size: 13px;
  line-height: 1.3;
}
.account-head span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}
.account-menu .divider {
  margin: 6px 2px;
}
.account-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 39px;
  padding: 0 10px;
  border-radius: 9px;
  color: var(--text-soft);
  font-size: 12.5px;
  text-align: left;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}
.account-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}
.account-item .i {
  width: 16px;
  height: 16px;
  color: var(--muted);
}
.account-item.danger {
  color: #ff8b7e;
}
.account-item.danger .i {
  color: #ff8b7e;
}

.page {
  flex: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 10px 26px 48px;
  animation: fade-up 0.35s var(--ease) both;
}
.page-wide {
  max-width: 1520px;
}

.mobile-scrim {
  display: none;
}

/* boot screen */
.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
}
.boot-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.boot-logo {
  width: 96px;
  height: auto;
  filter: drop-shadow(0 0 30px rgba(132, 74, 255, 0.28));
}
.boot-text {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.boot-line {
  width: 120px;
  height: 2px;
  overflow: hidden;
  border-radius: 9px;
  background: #1a1b20;
}
.boot-line::after {
  content: "";
  display: block;
  width: 50%;
  height: 100%;
  border-radius: inherit;
  background: var(--orange);
  animation: boot-slide 1s ease-in-out infinite alternate;
}
@keyframes boot-slide {
  from {
    transform: translateX(-20%);
  }
  to {
    transform: translateX(140%);
  }
}
