/* === Контейнер === */
.notes-board {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 1000px;
}

.notes-add-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 100;
    padding: 8px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s;
}
.notes-add-btn:hover {
    background: #2563eb;
}

/* === Заметка === */
.notes-note {
    position: absolute;
    box-sizing: border-box;
    border: 2px solid;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    user-select: none;
    transition: box-shadow 0.1s;
    background: #fff;
}
.notes-note.dragging,
.notes-note.resizing {
    opacity: 0.95;
    z-index: 9999 !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Важно: все вложенные элементы с border-box */
.notes-note *,
.notes-note *::before,
.notes-note *::after {
    box-sizing: border-box;
}

/* === Заголовок заметки === */
.notes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.05);
    cursor: move;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    min-height: 36px;
}

.notes-title {
    flex: 1;
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: 14px;
    outline: none;
    padding: 2px 4px;
    color: inherit;
}
.notes-title::placeholder {
    color: inherit;
    opacity: 0.6;
}

.notes-actions {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

.notes-icon-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s;
    color: inherit;
}
.notes-icon-btn:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* === Контент заметки === */
.notes-content {
    flex: 1;
    width: 100%;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    padding: 10px;
    font-size: 14px;
    line-height: 1.5;
    min-height: 50px;
    color: inherit;
}

/* === Хэндлы ресайза (8 направлений) === */
.notes-resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    z-index: 10;
    transition: background 0.1s, transform 0.1s;
}
.notes-resize-handle:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: scale(1.1);
}

/* Позиционирование хэндлов */
.notes-resize-handle[data-direction="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.notes-resize-handle[data-direction="n"]  { left: 50%; top: 0; transform: translateX(-50%); cursor: ns-resize; }
.notes-resize-handle[data-direction="ne"] { right: 0; top: 0; cursor: nesw-resize; }
.notes-resize-handle[data-direction="e"]  { right: 0; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.notes-resize-handle[data-direction="se"] { right: 0; bottom: 0; cursor: nwse-resize; }
.notes-resize-handle[data-direction="s"]  { left: 50%; bottom: 0; transform: translateX(-50%); cursor: ns-resize; }
.notes-resize-handle[data-direction="sw"] { left: 0; bottom: 0; cursor: nesw-resize; }
.notes-resize-handle[data-direction="w"]  { left: 0; top: 50%; transform: translateY(-50%); cursor: ew-resize; }

/* === ColorPicker === */
.notes-color-picker {
    box-sizing: border-box;
    position: fixed;
    z-index: 9999;
    padding: 10px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    min-width: 200px;
}
.notes-color-picker * {
    box-sizing: border-box;
}
.notes-color-picker button {
    box-sizing: border-box;
}