/* ============================================================
   Notes — two-panel layout + editor styles
   ============================================================ */

/* Layout */
.notes-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  min-height: calc(100vh - 80px);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 32px rgba(0,0,0,.04);
}

/* Sidebar */
.notes-sidebar {
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notes-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 14px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.notes-sidebar-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  margin: 0;
}

.notes-sidebar-icon {
  width: 16px;
  height: 16px;
  color: #6366f1;
  flex-shrink: 0;
}

.notes-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6366f1;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  padding: 5px 10px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.notes-new-btn:hover,
.notes-new-btn--active {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}

.notes-list {
  overflow-y: auto;
  flex: 1;
  padding: 8px 0;
}

.notes-empty-sidebar {
  padding: 32px 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.82rem;
  line-height: 1.6;
}

/* Note card */
.note-card {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid transparent;
  text-decoration: none;
  transition: background 0.12s;
  border-left: 3px solid transparent;
  cursor: pointer;
}

.note-card:hover {
  background: #f1f5f9;
}

.note-card--active {
  background: #eef2ff;
  border-left-color: #6366f1;
}

.note-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.note-card-pin-icon {
  width: 12px;
  height: 12px;
  color: #6366f1;
  flex-shrink: 0;
}

.note-card-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-card--active .note-card-title {
  color: #4f46e5;
}

.note-card-preview {
  font-size: 0.75rem;
  color: #64748b;
  margin: 0 0 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}

.note-card-date {
  font-size: 0.68rem;
  color: #94a3b8;
  margin: 0;
}

/* Color dot in card */
.note-card-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Main panel */
.notes-main {
  display: flex;
  flex-direction: column;
  background: #fff;
  min-height: 0;
}

/* Welcome / empty state */
.notes-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 400px;
  text-align: center;
  padding: 40px;
}

.notes-welcome-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.notes-welcome-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 10px;
}

.notes-welcome-desc {
  font-size: 0.875rem;
  color: #64748b;
  max-width: 360px;
  line-height: 1.65;
  margin: 0 0 24px;
}

.notes-welcome-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #6366f1;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 10px;
  padding: 10px 20px;
  text-decoration: none;
  transition: background 0.15s, transform 0.12s;
}

.notes-welcome-btn:hover {
  background: #4f46e5;
  transform: translateY(-1px);
}

/* Editor */
.note-editor {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  min-height: 0;
}

.note-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}

.note-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.note-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.note-toolbar-date {
  font-size: 0.72rem;
  color: #94a3b8;
}

.note-toolbar-label {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.note-toolbar-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: #22c55e;
  font-weight: 500;
  transition: opacity 0.3s;
}

.note-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  padding: 0;
}

.note-toolbar-btn:hover {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

.note-toolbar-btn--active {
  color: #6366f1;
  background: #eef2ff;
  border-color: #c7d2fe;
}

.note-toolbar-btn--danger:hover {
  background: #fef2f2;
  color: #ef4444;
  border-color: #fecaca;
}

/* Title input */
.note-title-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 1.3rem;
  font-weight: 700;
  color: #0f172a;
  padding: 20px 28px 8px;
  background: transparent;
  font-family: inherit;
  letter-spacing: -0.02em;
}

.note-title-input::placeholder {
  color: #cbd5e1;
}

/* Color picker */
.note-color-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 28px 12px;
}

.note-color-option {
  cursor: pointer;
}

.note-color-dot {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: transform 0.1s, border-color 0.1s;
}

.note-color-option:hover .note-color-dot,
.note-color-dot--selected {
  transform: scale(1.25);
  border-color: rgba(0,0,0,0.15);
}

/* Body textarea */
.note-body-input {
  width: 100%;
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.9375rem;
  line-height: 1.75;
  color: #1e293b;
  padding: 0 28px 28px;
  background: transparent;
  font-family: inherit;
  resize: none;
  overflow-y: auto;
  min-height: 320px;
}

.note-body-input::placeholder {
  color: #cbd5e1;
}

/* Footer (new note form) */
.note-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px 20px;
  border-top: 1px solid #f1f5f9;
  margin-top: auto;
}

.note-editor-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.note-cancel-btn {
  font-size: 0.875rem;
  color: #64748b;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  transition: background 0.12s;
}

.note-cancel-btn:hover {
  background: #f1f5f9;
}

.note-save-btn {
  background: #6366f1;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 9px 18px;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
  font-family: inherit;
}

.note-save-btn:hover {
  background: #4f46e5;
  transform: translateY(-1px);
}

/* Color palette values */
.note-color--default .note-color-dot,
.note-card-dot.note-color--default  { background: #cbd5e1; }

.note-color--yellow .note-color-dot,
.note-card-dot.note-color--yellow   { background: #facc15; }

.note-color--green .note-color-dot,
.note-card-dot.note-color--green    { background: #4ade80; }

.note-color--blue .note-color-dot,
.note-card-dot.note-color--blue     { background: #60a5fa; }

.note-color--pink .note-color-dot,
.note-card-dot.note-color--pink     { background: #f472b6; }

.note-color--purple .note-color-dot,
.note-card-dot.note-color--purple   { background: #a78bfa; }

/* Note card color accent */
.note-card--color-yellow.note-card--active  { border-left-color: #facc15; }
.note-card--color-green.note-card--active   { border-left-color: #4ade80; }
.note-card--color-blue.note-card--active    { border-left-color: #60a5fa; }
.note-card--color-pink.note-card--active    { border-left-color: #f472b6; }
.note-card--color-purple.note-card--active  { border-left-color: #a78bfa; }

/* ============================================================
   Responsive — mobile: stack layout
   ============================================================ */
@media (max-width: 768px) {
  .notes-layout {
    grid-template-columns: 1fr;
    min-height: auto;
    border-radius: 12px;
  }

  .notes-sidebar {
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
    max-height: 300px;
  }

  .note-title-input {
    font-size: 1.1rem;
    padding: 16px 16px 6px;
  }

  .note-body-input {
    padding: 0 16px 20px;
  }

  .note-color-picker {
    padding: 0 16px 10px;
  }

  .note-editor-toolbar {
    padding: 10px 16px;
  }

  .note-editor-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
  }
}
