/* ── Notebooks panel ─────────────────────────────────────────────── */

.nb-panel {
    display: flex;
    flex-direction: column;
    width: var(--list-panel-width);
    flex-shrink: 0;
    border-right: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    overflow: hidden;
}

/* ── Panel header ────────────────────────────────────────────────── */
.nb-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.nb-panel-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}

/* ── Notebook tree ───────────────────────────────────────────────── */
.nb-tree {
    overflow-y: auto;
    max-height: 40%;
    flex-shrink: 0;
    padding: 6px 0;
}

.nb-tree-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: var(--radius);
    margin: 1px 6px;
    font-size: 13px;
    color: var(--color-text);
    user-select: none;
    transition: background var(--transition);
    position: relative;
}

.nb-tree-item:hover {
    background: var(--color-bg-hover);
}

.nb-tree-item.active {
    background: var(--color-accent-light);
    color: var(--color-accent);
    font-weight: 500;
}

.nb-item-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--color-text-muted);
}

.nb-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nb-count {
    font-size: 11px;
    color: var(--color-text-muted);
    background: var(--color-bg-hover);
    padding: 1px 6px;
    border-radius: 10px;
    flex-shrink: 0;
}

.nb-tree-item.active .nb-count {
    background: var(--color-accent);
    color: #fff;
}

/* ── Chevron toggle ──────────────────────────────────────────────── */
.nb-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 4px;
    color: var(--color-text-muted);
    transition: transform var(--transition);
}

.nb-chevron:hover {
    background: var(--color-border);
}

.nb-chevron svg {
    width: 14px;
    height: 14px;
    transition: transform var(--transition);
}

.nb-chevron.open svg {
    transform: rotate(90deg);
}

/* ── Notebook color dot ──────────────────────────────────────────── */
.nb-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Context menu button ─────────────────────────────────────────── */
.nb-menu-btn {
    opacity: 0;
    transition: opacity var(--transition);
    flex-shrink: 0;
    color: var(--color-text-muted);
    border-radius: 4px;
    padding: 2px;
    display: flex;
    align-items: center;
}

.nb-menu-btn:hover {
    background: var(--color-border);
    color: var(--color-text);
}

.nb-tree-item:hover .nb-menu-btn,
.nb-tree-item.active .nb-menu-btn {
    opacity: 1;
}

/* ── Sections container ──────────────────────────────────────────── */
.nb-sections-container {
    display: none;
    flex-direction: column;
}

.nb-sections-container.open {
    display: flex;
}

/* ── Section row ─────────────────────────────────────────────────── */
.nb-section-row {
    padding-left: 36px;
}

.nb-section-color {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── Add section button ──────────────────────────────────────────── */
.nb-add-section-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 2px 6px 2px 36px;
    padding: 4px 8px;
    font-size: 12px;
    color: var(--color-text-muted);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.nb-add-section-btn:hover {
    background: var(--color-bg-hover);
    color: var(--color-accent);
}

.nb-add-section-btn svg {
    width: 13px;
    height: 13px;
}

/* ── Notes subpanel ──────────────────────────────────────────────── */
.nb-notes-subpanel {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--color-border);
}

.nb-notes-subpanel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px 8px;
    flex-shrink: 0;
    gap: 6px;
}

.nb-section-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.nb-notes-subpanel-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* ── Context menu ────────────────────────────────────────────────── */
.nb-context-menu {
    position: fixed;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px var(--color-shadow);
    z-index: 400;
    min-width: 150px;
    padding: 4px 0;
}

.nb-context-item {
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    color: var(--color-text);
    transition: background var(--transition);
}

.nb-context-item:hover {
    background: var(--color-bg-hover);
}

.nb-context-item.danger {
    color: var(--color-danger);
}

/* ── Color palette (in modals) ───────────────────────────────────── */
.nb-palette {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 4px 0;
}

.nb-palette-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform var(--transition), border-color var(--transition);
}

.nb-palette-dot:hover {
    transform: scale(1.15);
}

.nb-palette-dot.active {
    border-color: var(--color-text);
    transform: scale(1.1);
}

/* ── Note breadcrumb pill ────────────────────────────────────────── */
.note-breadcrumb {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    color: var(--color-accent);
    background: var(--color-accent-light);
    padding: 2px 8px;
    border-radius: 10px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Move note option ────────────────────────────────────────────── */
.nb-move-option {
    font-size: 13px;
    transition: background var(--transition);
}

.nb-move-option.active {
    color: var(--color-accent);
    font-weight: 500;
}
