:root {
  --bg: #fdf2f8;
  --card: #ffffff;
  --menu-accent: #4f46e5;
  --menu-accent-2: #ec4899;
  --muted: #64748b;
  --border: #e5e7eb;
  --sidebar-width: 225px;
  --border-radius: 12px;
  --primary-color: #ec4899;
  --primary-hover: #db2777;
}

body {
  margin: 0;
  background: var(--bg);
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(10px);
}

.topbar .left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar img {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #07110d;
}

.topbar h1 {
  margin: 0;
  color: var(--primary-color);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0;
  text-shadow: 2px 2px 0 #fce7f3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #eef2ff;
  color: #334155;
  box-shadow: none;
  cursor: pointer;
  font-size: 0;
}

.menu-btn::before {
  content: "☰";
  font-size: 24px;
  line-height: 1;
  font-weight: 700;
}

.sidebar {
  position: fixed;
  top: 0;
  left: -270px;
  z-index: 200;
  width: var(--sidebar-width);
  height: 100%;
  box-sizing: content-box;
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--card);
  border-right: 1px solid var(--border);
  border-radius: 0 8px 8px 0;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
  transition: left 0.3s ease;
}

.sidebar.active {
  left: 0;
}

.sidebar h2 {
  flex: 0 0 auto;
  margin-bottom: 20px;
  color: #111827;
  font-size: 16px;
  font-weight: 600;
  line-height: normal;
}

#menuTitle {
  flex-shrink: 0;
  margin-bottom: 12px;
}

#menuContainer {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 0 12px 0;
  box-sizing: border-box;
  scrollbar-width: thin;
}

#menuContainer::-webkit-scrollbar {
  width: 7px;
}

#menuContainer::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c7cbd3;
}

.menu a {
  display: block;
  min-height: 0;
  box-sizing: content-box;
  margin-bottom: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  line-height: normal;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.menu a:hover {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: var(--menu-accent);
}

.menu a.active {
  border-color: var(--menu-accent);
  background: var(--menu-accent);
  color: #ffffff;
  font-weight: 600;
}

.menu a.has-submenu {
  position: relative;
  padding-right: 24px;
  cursor: pointer;
}

.menu a.has-submenu::after {
  content: "◀";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  line-height: 1;
}

.menu a.has-submenu.active::after,
.menu a.has-submenu[aria-expanded="true"]::after {
  content: "▼";
}

.submenu {
  display: none;
  margin: 0 0 0 16px;
  padding: 0 0 0 10px;
  border-left: 2px solid var(--border);
}

.submenu a.submenu-item {
  display: block;
  min-height: 0;
  box-sizing: content-box;
  margin-bottom: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 400;
  background: #ffffff;
}

.submenu a.submenu-item.active {
  border-color: var(--menu-accent);
  background: var(--menu-accent);
  color: #ffffff;
  font-weight: 600;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(15, 23, 42, 0.36);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

body:has(.sidebar.active) {
  overflow: hidden;
}

@media (max-width: 520px) {
  .sidebar {
    padding: 20px;
  }

  .sidebar h2 {
    margin-bottom: 20px;
  }

  .submenu {
    margin-left: 16px;
    padding-left: 10px;
  }
}
