:root {
  --bg: #fefcff;
  --surface: #ffffff;
  --surface-soft: #fffaff;
  --ink: #2b2440;
  --muted: #808080;
  --line: #e5e5e5;
  --line-soft: #f0e8f4;
  --primary: #442c8c;
  --primary-soft: rgba(68, 44, 140, 0.1);
  --aux: #b789d6;
  --aux-soft: #e8caff;
  --blue: #0238a4;
  --blue-soft: rgba(2, 56, 164, 0.1);
  --green: #6fc25a;
  --green-soft: rgba(111, 194, 90, 0.12);
  --amber: #ea7d45;
  --amber-soft: rgba(234, 125, 69, 0.12);
  --red: #dc2d1e;
  --red-soft: rgba(220, 45, 30, 0.1);
  --shadow: 0 4px 16px rgba(68, 44, 140, 0.12);
  --radius: 8px;
  --font: "Century Gothic", "Avenir Next", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --topbar-height: 96px;
  --rail-width: 280px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: var(--topbar-height) 1fr;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  height: auto;
  min-height: var(--topbar-height);
  padding: 0;
  background: var(--primary);
  color: #fff;
  border-bottom: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0;
  height: var(--topbar-height);
  flex: 1 1 auto;
  min-width: 0;
}

.starry-logo {
  width: var(--rail-width);
  height: var(--topbar-height);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 var(--rail-width);
}

.starry-logo img {
  width: 170px;
  height: 65px;
  display: block;
  object-fit: contain;
}

.title-wrap {
  height: var(--topbar-height);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7px 8px 7px 108px;
  min-width: 0;
}

.title {
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 1.3px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subtitle {
  margin: 4px 0 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  line-height: 18px;
  letter-spacing: 0.6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  min-height: var(--topbar-height);
  padding: 0 96px 0 8px;
  flex: 0 0 auto;
}

.top-icon {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff;
}

.top-icon > img:first-child {
  width: 24px;
  height: 24px;
  display: block;
  object-fit: contain;
}

.top-icon .notification-dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 10px;
  height: 10px;
}

.layout {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  gap: 0;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 0;
  background: var(--bg);
}

.rail,
.main {
  min-width: 0;
}

.rail {
  position: fixed;
  left: 0;
  top: var(--topbar-height);
  z-index: 9;
  width: var(--rail-width);
  height: calc(100vh - var(--topbar-height));
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 14px 24px;
  border: 0;
  border-radius: 0;
  background: var(--aux);
  color: rgba(255, 255, 255, 0.76);
  box-shadow: none;
}

.menu-toggle {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
}

.side-menu {
  display: grid;
  align-content: start;
  gap: 15px;
  padding: 0;
}

.nav-section,
.nav-item {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--aux-soft);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.48px;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
}

.nav-section {
  color: var(--aux-soft);
  font-size: 16px;
  pointer-events: none;
  text-transform: uppercase;
}

.menu-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 40px;
  border-radius: 10px;
}

.menu-icon img {
  width: 20px;
  height: 20px;
  display: block;
  object-fit: contain;
}

.nav-label {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-parent {
  justify-content: flex-start;
}

.nav-item.is-static,
.nav-item:not([data-shell-nav]) {
  cursor: default;
}

.nav-item.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 3px 10px rgba(68, 44, 140, 0.16);
}

.side-user {
  width: 250px;
  height: 48px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 5px;
  margin: 0 auto 80px;
  padding: 8px 24px;
  border: 1px solid var(--aux-soft);
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
}

.user-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.user-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.side-user-name {
  overflow: hidden;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.48px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main {
  grid-column: 2;
  min-height: calc(100vh - var(--topbar-height));
  padding: 28px 32px 40px;
  background: var(--bg);
}

.icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  flex: 0 0 auto;
}

@media (max-width: 820px) {
  html,
  body,
  .app {
    max-width: 100vw;
    overflow-x: hidden;
  }

  .app {
    display: block;
  }

  .topbar {
    width: 100%;
    max-width: 100vw;
    min-height: 96px;
    align-items: flex-start;
    flex-direction: column;
    padding: 12px;
  }

  .brand {
    width: 100%;
    min-width: 0;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .title-wrap {
    width: 100%;
    flex: 1 1 auto;
    height: auto;
    padding: 0;
  }

  .starry-logo {
    width: 170px;
    height: 56px;
    flex-basis: auto;
    font-size: 30px;
    line-height: 34px;
  }

  .starry-logo img {
    width: 150px;
    height: auto;
  }

  .title {
    overflow: visible;
    font-size: 16px;
    line-height: 21px;
    text-overflow: clip;
    white-space: normal;
  }

  .subtitle {
    overflow: visible;
    text-overflow: clip;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    min-height: 0;
    padding: 0;
  }

  .layout {
    display: block;
    width: 100%;
    max-width: 100vw;
    padding: 12px;
  }

  .rail {
    position: static;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: auto;
    margin-bottom: 12px;
    overflow: visible;
    border-radius: 12px;
  }

  .side-menu {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .nav-item,
  .nav-section {
    width: 100%;
    min-width: 0;
  }

  .side-user {
    width: min(250px, 100%);
    margin: 12px auto 0;
  }

  .main {
    grid-column: auto;
    width: 100%;
    max-width: 100%;
    padding: 0;
    overflow-x: hidden;
  }
}
