/* ── Notes List ──────────────────────────────────────────────────── */
.note-card {
    padding: 10px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    border: 1px solid transparent;
    margin-bottom: 4px;
    transition: background var(--transition), border-color var(--transition);
    position: relative;
}
.note-card:hover { background: var(--color-bg-hover); }
.note-card.active {
    background: var(--color-accent-light);
    border-color: var(--color-accent);
}
.note-card-title {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 3px;
}
.note-card-preview {
    font-size: 11px;
    color: var(--color-text-muted);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}
.note-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}
.note-card-date {
    font-size: 10px;
    color: var(--color-text-muted);
    margin-left: auto;
}
.note-pin-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    color: var(--color-accent);
    opacity: 0.7;
}
.note-pin-indicator i { width: 12px; height: 12px; }
.note-color-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: var(--radius) 0 0 var(--radius);
}

/* ── Note Editor ─────────────────────────────────────────────────── */
.note-editor-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}
.note-editor-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.note-editor-header .icon-btn { color: var(--color-text-muted); }
.note-title-input {
    flex: 1;
    font-size: 18px;
    font-weight: 700;
    border: none;
    outline: none;
    background: transparent;
    color: var(--color-text);
    padding: 0;
}
.note-title-input::placeholder { color: var(--color-text-muted); }
.note-editor-toolbar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--color-border);
    flex-wrap: wrap;
    flex-shrink: 0;
}
.note-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-bottom: 1px solid var(--color-border);
    font-size: 12px;
    color: var(--color-text-muted);
    flex-shrink: 0;
    flex-wrap: wrap;
}
.note-meta-row .tag-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.note-quill-area {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
/* Make Quill fill the area */
.note-quill-area .ql-container {
    flex: 1;
    overflow-y: auto;
    font-family: var(--font);
    font-size: 14px;
    border: none !important;
}
.note-quill-area .ql-toolbar {
    border: none !important;
    border-bottom: 1px solid var(--color-border) !important;
    background: var(--color-bg-secondary);
    padding: 6px 12px;
    flex-shrink: 0;
}
.note-quill-area .ql-editor {
    padding: 16px 20px;
    min-height: 200px;
}
.note-quill-area .ql-editor.ql-blank::before {
    color: var(--color-text-muted);
    font-style: normal;
}

/* Dark mode Quill overrides */
[data-theme="dark"] .ql-toolbar { background: var(--color-bg-secondary); }
[data-theme="dark"] .ql-toolbar .ql-stroke { stroke: var(--color-text-muted); }
[data-theme="dark"] .ql-toolbar .ql-fill { fill: var(--color-text-muted); }
[data-theme="dark"] .ql-toolbar .ql-picker { color: var(--color-text-muted); }
[data-theme="dark"] .ql-toolbar button:hover .ql-stroke,
[data-theme="dark"] .ql-toolbar button.ql-active .ql-stroke { stroke: var(--color-accent); }
[data-theme="dark"] .ql-editor { color: var(--color-text); }

/* Attachments panel */
.note-attachments-panel {
    border-top: 1px solid var(--color-border);
    padding: 10px 16px;
    flex-shrink: 0;
}
.attachments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.attachments-header span {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.attachments-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.attachment-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 11px;
    background: var(--color-bg-secondary);
    cursor: pointer;
    transition: background var(--transition);
    max-width: 180px;
}
.attachment-chip:hover { background: var(--color-bg-hover); }
.attachment-chip i { width: 12px; height: 12px; color: var(--color-accent); flex-shrink: 0; }
.attachment-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.attachment-chip .del-attach {
    color: var(--color-text-muted);
    margin-left: 2px;
    flex-shrink: 0;
}
.attachment-chip .del-attach:hover { color: var(--color-danger); }

/* Linked events in note */
.linked-events-panel {
    border-top: 1px solid var(--color-border);
    padding: 10px 16px;
    flex-shrink: 0;
}
.linked-events-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.linked-events-header span {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.linked-events-list { display: flex; flex-direction: column; gap: 4px; }
.linked-event-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    font-size: 12px;
    background: var(--color-bg-secondary);
}
.linked-event-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.linked-event-title { font-weight: 500; flex: 1; }
.linked-event-date { color: var(--color-text-muted); font-size: 11px; }

/* EventCard blot (custom Quill embed) */
.ql-event-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    margin: 4px 0;
    cursor: default;
    user-select: none;
}
.ql-event-card-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ql-event-card-title { font-weight: 600; font-size: 13px; }
.ql-event-card-date { font-size: 11px; color: var(--color-text-muted); margin-left: auto; }

/* Pinned section separator */
.notes-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    padding: 8px 4px 4px;
}
