/* ── list items ────────────────────────────────── */

.list-items {
  display: flex;
  flex-direction: column;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: color 0.15s;
}

.list-item:hover .list-name {
  color: var(--accent);
}

.list-item .btn {
  width: auto;
  white-space: nowrap;
}

.list-name {
  color: var(--text);
}

.list-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── todo items ────────────────────────────────── */

.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.todo-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.todo-checkbox:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.todo-title {
  flex: 1;
  color: var(--text);
  cursor: pointer;
}

.todo-title.done {
  color: var(--text-muted);
  text-decoration: line-through;
}

/* ── drag handle ───────────────────────────────── */

.drag-handle {
  color: var(--border);
  cursor: grab;
  padding: 0 4px;
  flex-shrink: 0;
  user-select: none;
  touch-action: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.is-dragging {
  opacity: 0.5;
}

/* ── item due badge ────────────────────────────── */

.item-meta {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── item detail view ──────────────────────────── */

.item-detail {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.item-title-input {
  font-size: 18px;
  letter-spacing: 0.05em;
  width: 100%;
}

.item-meta-row {
  display: flex;
  gap: var(--gap);
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.field-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── notes ─────────────────────────────────────── */

.notes-section-title {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.note-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.note-text {
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.note-link {
  color: var(--accent);
  text-decoration: underline;
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  cursor: pointer;
}

.note-textarea {
  resize: vertical;
  min-height: 80px;
  width: 100%;
}

/* save/cancel on left, delete on right */
.note-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.note-actions-left {
  display: flex;
  gap: 8px;
}

.note-actions .btn,
.note-actions-left .btn {
  width: auto;
}

/* ── add note form ─────────────────────────────── */

.add-note-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.add-note-form .btn {
  align-self: flex-end;
  width: auto;
}
