:root{
  --bg: #ffffff;
  --panel: #f7f7f7;
  --fg: #111111;
  --muted: #666666;
  --accent: #000000;
  --border: #e6e6e6;
  --shadow: rgba(16,24,40,0.04);
}

/* Reset and base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.45;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(180deg, #ffffff, #fbfbfb);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--shadow);
}
.topbar button {
  background: transparent;
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--fg);
  font-size: 14px;
}
.topbar button:hover {
  background: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

/* Layout */
.container {
  display: flex;
  height: calc(100vh - 56px);
  min-height: 480px;
}

/* Panels */
.panel {
  background: var(--panel);
  padding: 14px;
  min-width: 220px;
  max-width: 360px;
  overflow: auto;
  border-right: 1px solid var(--border);
}
.panel.small { min-width: 260px; max-width: 360px; }

/* Editor area */
#editor {
  flex: 1;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
}

/* Inputs and textarea */
#noteTitle {
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 8px;
  margin: 0;
  font-size: 16px;
  color: var(--fg);
  background: #fff;
  outline: none;
}
#noteTitle:focus { box-shadow: 0 6px 18px rgba(0,0,0,0.04); border-color: #d6d6d6; }

#noteContent {
  flex: 1;
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 8px;
  resize: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", monospace;
  font-size: 14px;
  color: var(--fg);
  background: #ffffff;
  line-height: 1.6;
  outline: none;
}
#noteContent:focus { box-shadow: 0 8px 24px rgba(0,0,0,0.04); border-color: #d6d6d6; }

/* Buttons */
.editor-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
button {
  background: #ffffff;
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
button:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.04); }

/* Login box */
.login {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--bg);
}
.login-box {
  background: #ffffff;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 320px;
  box-shadow: 0 10px 30px rgba(16,24,40,0.06);
}
.login-box h2 { margin: 0 0 12px 0; color: var(--fg); }
.login-box input {
  width: 100%;
  padding: 10px 12px;
  margin: 8px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--fg);
  font-size: 14px;
}

/* Panels items */
.panel .item {
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
  color: var(--fg);
}
.panel .item:hover {
  background: #ffffff;
  border-color: var(--border);
  box-shadow: 0 6px 18px rgba(0,0,0,0.03);
}
.panel .item.active {
  background: #f0f7ff;
  border-color: #d6e8ff;
}

/* Small meta text */
.small-note-meta { font-size: 12px; color: var(--muted); }

/* Responsive tweaks */
@media (max-width: 900px) {
  .panel { display: none; }
  .panel.small { display: none; }
  .container { height: auto; flex-direction: column; }
  #editor { min-height: calc(100vh - 120px); }
}


/* --- Toast / Notification --- */
.toast {
  position: fixed;
  right: 20px;
  bottom: 24px;
  background: #111827;
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16,24,40,0.12);
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* --- Inline confirm bar (bottom) --- */
.confirm-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 20px;
  background: #ffffff;
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(16,24,40,0.08);
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 9998;
}
.confirm-bar .msg { margin-right: 8px; font-size: 14px; color: var(--fg); }
.confirm-bar button { padding: 8px 10px; border-radius: 8px; }

/* --- Prompt modal --- */
.prompt-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.prompt-modal {
  background: #fff;
  padding: 18px;
  border-radius: 10px;
  width: 360px;
  max-width: calc(100% - 40px);
  box-shadow: 0 12px 40px rgba(16,24,40,0.12);
}
.prompt-modal h3 { margin: 0 0 8px 0; font-size: 16px; color: var(--fg); }
.prompt-modal input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 14px;
}
.prompt-modal .row { display:flex; gap:8px; justify-content:flex-end; }
.prompt-modal button { padding:8px 12px; border-radius:8px; }

