/* Riêng cho modules/notes.js — danh sách thẻ + khung soạn thảo */

.notes-shell { display: flex; gap: 16px; align-items: flex-start; }
.notes-side { width: 220px; flex-shrink: 0; }
.notes-side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.notes-list { display: flex; flex-direction: column; gap: 3px; }
.notes-item {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; border-radius: var(--radius); cursor: pointer; font-size: 13px; color: var(--ink);
}
.notes-item:hover { background: var(--surface-muted); }
.notes-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.notes-item.selected { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.notes-item-title {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  user-select: none;
}
.notes-item-more {
  opacity: 0; border: none; background: transparent; color: var(--ink-muted);
  cursor: pointer; padding: 2px 5px; border-radius: 6px; font-size: 14px; line-height: 1;
}
.notes-item:hover .notes-item-more,
.notes-group-head:hover .notes-item-more,
.notes-item-more:focus-visible { opacity: 1; }
.notes-item-more:hover { background: var(--surface-muted); color: var(--ink); }

/* Nhóm thẻ */
.notes-group { margin-bottom: 2px; }
.notes-group-head {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 6px 8px; border-radius: var(--radius);
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  color: var(--ink-muted); text-transform: uppercase;
}
.notes-group-head:hover { background: var(--surface-muted); }
.notes-group-caret { width: 10px; flex-shrink: 0; font-size: 10px; }
.notes-group-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: none; }
.notes-group-count {
  background: var(--surface-muted); color: var(--ink-muted);
  border-radius: 100px; padding: 0 6px; font-size: 11px; font-weight: 600;
}
.notes-group-body { display: flex; flex-direction: column; gap: 3px; padding-left: 12px; border-left: 1px solid var(--line); margin-left: 12px; }
.notes-group-empty { margin: 4px 0 4px 10px; font-size: 12px; color: var(--ink-muted); }

/* Ô đổi tên tại chỗ (bấm đúp) */
.notes-rename-input {
  flex: 1; min-width: 0; font: inherit; color: var(--ink); text-transform: none;
  padding: 2px 6px; border: 1px solid var(--accent); border-radius: 6px; background: var(--surface);
}
.notes-rename-input:focus-visible { outline: none; }

/* Thanh khi chọn nhiều thẻ */
.notes-selbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: var(--accent-soft); border-radius: var(--radius);
  padding: 6px 8px; margin-bottom: 8px;
}
.notes-selbar[hidden] { display: none; }
.notes-selbar-count { flex: 1 0 100%; font-size: 12px; font-weight: 600; color: var(--accent-ink); }
.notes-hint { margin: 10px 2px 0; font-size: 11.5px; line-height: 1.5; color: var(--ink-muted); }

/* Menu dấu 3 chấm */
.notes-menu {
  position: fixed; z-index: 60; min-width: 190px; max-width: 260px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-soft);
  padding: 6px; display: flex; flex-direction: column; gap: 1px;
}
.notes-menu-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: none; background: transparent; cursor: pointer; text-align: left;
  padding: 7px 9px; border-radius: var(--radius); font-size: 13px; color: var(--ink);
}
.notes-menu-item:hover { background: var(--surface-muted); }
.notes-menu-item.danger { color: var(--red); }
.notes-menu-item.danger:hover { background: var(--red-soft); }
.notes-menu-item > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-menu-hint { flex-shrink: 0; font-size: 11px; color: var(--ink-muted); }
.notes-menu-sep { height: 1px; background: var(--line); margin: 4px 2px; }
.notes-menu-label {
  padding: 6px 9px 2px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em; color: var(--ink-muted);
}

.notes-editor {
  flex: 1; min-width: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px;
  box-shadow: var(--shadow-card);
}
.notes-title-input {
  border: none; font-size: 19px; font-weight: 700; padding: 2px 0 10px;
  width: 100%; background: transparent; border-bottom: 1px solid var(--line); margin-bottom: 12px;
}
.notes-title-input:focus-visible { outline: none; border-bottom-color: var(--accent); }
.editor-toolbar { display: flex; gap: 4px; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.editor-toolbar button {
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: var(--radius);
  border: 1px solid transparent; background: transparent; color: var(--ink-muted);
  cursor: pointer; font-weight: 700; font-size: 12.5px;
}
.editor-toolbar button:hover { background: var(--surface-muted); color: var(--ink); }
.editor-body { min-height: 360px; font-size: 14px; line-height: 1.7; outline: none; }
.editor-body ul, .editor-body ol { padding-left: 22px; }
.editor-body h2 { font-size: 17px; margin: 4px 0; }
.editor-body:empty::before { content: attr(data-placeholder); color: var(--ink-muted); }

@media (max-width: 760px) {
  .notes-shell { flex-direction: column; }
  .notes-side { width: 100%; }
}
