* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  height: 100vh;
  overflow: hidden;
  background: #1e1e2e;
  color: #cdd6f4;
}

#app {
  display: flex;
  height: 100vh;
}

#sidebar {
  width: 260px;
  min-width: 180px;
  background: #181825;
  border-right: 1px solid #313244;
  display: flex;
  flex-direction: column;
}

#sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #313244;
}

#sidebar-header h2 {
  font-size: 16px;
  font-weight: 600;
}

#btn-new {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: #cba6f7;
  color: #1e1e2e;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

#btn-new:hover {
  background: #b4befe;
}

#note-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding: 4px;
}

#note-list li {
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.1s;
}

#note-list li:hover {
  background: #313244;
}

#note-list li.active {
  background: #45475a;
  color: #cdd6f4;
}

#editor-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#editor-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c7086;
  font-size: 16px;
}

#editor-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#editor-content.hidden,
#editor-empty.hidden {
  display: none;
}

#editor-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid #313244;
}

#note-title {
  flex: 1;
  background: transparent;
  border: none;
  color: #cdd6f4;
  font-size: 18px;
  font-weight: 600;
  outline: none;
}

#note-title::placeholder {
  color: #585b70;
}

#btn-delete {
  padding: 6px 14px;
  border: 1px solid #f38ba8;
  border-radius: 6px;
  background: transparent;
  color: #f38ba8;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

#btn-delete:hover {
  background: #f38ba8;
  color: #1e1e2e;
}

#note-content {
  flex: 1;
  background: transparent;
  border: none;
  color: #cdd6f4;
  font-size: 15px;
  line-height: 1.7;
  padding: 20px;
  resize: none;
  outline: none;
  font-family: inherit;
}

#note-content::placeholder {
  color: #585b70;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #45475a;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #585b70;
}
