:root {
  --bg: #fefcff;
  --surface: #ffffff;
  --surface-tint: #faf2ff;
  --ink: #2b2440;
  --text: #000000;
  --muted: #808080;
  --muted-soft: #b3b3b3;
  --line: #e5e5e5;
  --line-soft: #f2f2f2;
  --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: #4c9f4f;
  --green-soft: #eaf6e8;
  --orange: #f26f3f;
  --orange-soft: #ffebe4;
  --red: #dc2d1e;
  --red-soft: #ffe7e5;
  --shadow: 0 2px 10px rgba(68, 44, 140, 0.14);
  --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;
}

html,
body {
  min-height: 100%;
}

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 {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.app {
  min-height: 100vh;
  display: block;
  padding-top: var(--topbar-height);
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

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

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

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

.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 {
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  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;
}

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

.layout {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  background: var(--bg);
}

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

.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;
}

.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-item.active {
  background: #fff;
  color: var(--primary);
}

.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;
}

.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;
  overflow: hidden;
  border-radius: 999px;
  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: 0 10px 40px;
  background: var(--bg);
}

.workspace {
  width: min(1440px, 100%);
  margin: 0 auto;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--muted-soft);
}

.title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.title-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}

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

h1 {
  margin: 0;
  color: var(--primary);
  font-size: 26px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 1.3px;
}

.btn,
.icon-btn,
.text-btn {
  border: 0;
  border-radius: 8px;
  font-weight: 900;
  line-height: 1.2;
}

.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 20px;
  border: 1px solid transparent;
  background: var(--aux);
  color: #fff;
  white-space: nowrap;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.secondary {
  background: var(--surface-tint);
  color: var(--primary);
}

.btn.neutral {
  background: #e5e5e5;
  color: #000;
}

.btn.small {
  min-height: 32px;
  padding: 7px 12px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.45;
}

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  background: var(--surface-tint);
  color: var(--aux);
}

.icon-btn img,
.btn img,
.text-btn img {
  width: 20px;
  height: 20px;
  display: block;
  object-fit: contain;
  flex: 0 0 auto;
}

.text-btn {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  background: var(--surface-tint);
  color: var(--aux);
  font-size: 12px;
  white-space: nowrap;
}

.empty-page {
  min-height: 420px;
  display: grid;
  place-items: center;
  padding: 48px 20px;
  color: var(--muted);
  font-weight: 900;
}

.empty-panel {
  width: min(520px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: center;
  box-shadow: var(--shadow);
}

.toast-stack {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 120;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 56px));
  pointer-events: none;
}

.toast {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 8px;
  background: #fff;
  color: #000;
  box-shadow: 0 10px 30px rgba(31, 24, 48, 0.18);
  font-weight: 900;
  pointer-events: auto;
}

.toast.success::before,
.toast.info::before {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  content: "i";
}

.toast.success::before {
  content: "+";
  background: var(--green);
}

@media (max-width: 820px) {
  :root {
    --topbar-height: 176px;
  }

  html,
  body,
  .app {
    max-width: 100vw;
    overflow-x: hidden;
  }

  .app {
    display: block;
  }

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

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

  .starry-logo {
    width: 170px;
    height: 56px;
    flex-basis: auto;
  }

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

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

  .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%;
    min-height: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
    padding: 0;
  }

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

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

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

  .nav-item {
    width: 100%;
  }

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

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

  .workspace {
    width: 100%;
    max-width: calc(100vw - 28px);
  }

  .page-head {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  h1 {
    white-space: normal;
  }

  .text-btn {
    justify-content: flex-start;
    white-space: normal;
  }
}
