/* ==========================================================================
   Prox'Wide Notes Module
   Clean, properly structured CSS for Google Keep style layout
   ========================================================================== */

/* 1. CORE SHELL */

/* Fill the viewport below the fixed app-header */
.main-content.notes-view {
    max-width: 100%;
    padding: 0;
    height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body #app .notes-layout {
    display: flex;
    width: 100%;
    height: calc(100vh - 50px);
    background: var(--bg-body);
    overflow: hidden;
}

/* ── Sidebar: fixed height, never scrolls with content ── */
body #app .notes-sidebar {
    width: 280px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color, #e0e0e0);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 16px 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

[data-theme="neon"] body #app .notes-sidebar {
    border-right: 1px solid var(--hud-line);
    background: var(--bg-sidebar);
}

/* Sidebar styling */
body #app .notes-sidebar .sidebar-header {
    padding: 0 16px 16px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body #app .keepcat-logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

body #app .keepcat-logo {
    height: 32px;
    width: auto;
    filter: var(--logo-filter);
}

[data-theme="neon"] body #app .keepcat-logo {
    animation: chromatic-aberration 3s infinite ease-in-out;
}

body #app .keepcat-logo-container h3 {
    margin: 0;
    font-size: 22px;
    color: var(--text-main);
    font-weight: 600;
}

[data-theme="neon"] body #app .keepcat-logo-container h3 {
    font-family: 'Cyberpunk', sans-serif;
    color: #fcee09 !important; /* Jaune Cyberpunk pur */
    letter-spacing: 2px;
    text-shadow: 
        1px 1px 0 var(--info),
        -1px -1px 0 var(--secondary);
    text-transform: uppercase;
}

body #app .nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

body #app .nav-links li {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    border-radius: 0 24px 24px 0;
    margin-right: 16px;
    color: var(--text-main);
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

body #app .nav-links li:hover {
    background: rgba(0,0,0,0.05);
}

body #app .nav-links li.active {
    background: #e8f0fe;
    color: var(--primary, #1a73e8);
}
.dark-mode body #app .nav-links li.active,
[data-theme="dark"] body #app .nav-links li.active {
    background: rgba(59, 130, 246, 0.2);
}
[data-theme="neon"] body #app .nav-links li.active {
    background: rgba(0, 243, 255, 0.1);
    color: var(--info);
    border-radius: 0;
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.3);
}
[data-theme="neon"] body #app .nav-links li:hover:not(.active) {
    background: rgba(181, 55, 255, 0.1);
    color: var(--secondary);
}

body #app .nav-links li i {
    font-size: 20px;
}

/* "Modifier les libellés" button at bottom of sidebar */
body #app .edit-labels-btn {
    margin-top: auto;
    margin: auto 16px 16px 16px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    width: calc(100% - 32px);
}
body #app .edit-labels-btn:hover {
    background: rgba(0,0,0,0.05);
    color: var(--text-main);
}
[data-theme="neon"] body #app .edit-labels-btn {
    border-color: var(--hud-line);
    border-radius: 2px;
    background: rgba(181, 55, 255, 0.05);
}
[data-theme="neon"] body #app .edit-labels-btn:hover {
    border-color: var(--secondary);
    background: rgba(181, 55, 255, 0.15);
    color: var(--secondary);
    box-shadow: 0 0 10px rgba(181, 55, 255, 0.2);
}

/* ── Label Editor Modal (Keep-style) ── */
body #app .label-editor-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

body #app .label-editor-modal {
    background: var(--bg-card);
    border-radius: 4px;
    width: 320px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 24px rgba(0,0,0,0.25);
    overflow: hidden;
}
[data-theme="neon"] body #app .label-editor-modal {
    background: var(--bg-modal);
    border: 1px solid transparent;
    box-shadow: inset 0 0 0 1px var(--border-panel);
    clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 15px, 100% 100%, 0 100%);
}

body #app .label-editor-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-main);
    padding: 20px 24px 12px;
    margin: 0;
}

body #app .label-editor-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 0;
}

body #app .label-editor-list {
    overflow-y: auto;
    flex: 1;
}

body #app .label-editor-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 16px;
    min-height: 48px;
}
body #app .label-editor-create-row {
    padding: 8px 12px 8px 16px;
}

body #app .label-editor-add-icon,
body #app .label-editor-tag-icon {
    font-size: 20px;
    color: var(--text-muted);
    flex-shrink: 0;
}
body #app .label-editor-tag-icon {
    color: var(--text-main);
}

body #app .label-editor-name {
    flex: 1;
    font-size: 14px;
    color: var(--text-main);
}

body #app .label-editor-input {
    flex: 1;
    border: none;
    border-bottom: 1px solid var(--primary);
    background: transparent;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    padding: 2px 0;
}

body #app .label-editor-row-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

body #app .label-editor-icon-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 16px;
    transition: background 0.15s;
}
body #app .label-editor-icon-btn:hover {
    background: rgba(0,0,0,0.08);
    color: var(--text-main);
}
body #app .label-editor-icon-btn.confirm {
    color: var(--primary);
}

body #app .label-editor-footer {
    padding: 8px 8px 8px 0;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
}

body #app .label-editor-done-btn {
    padding: 8px 24px;
    background: none;
    border: none;
    border-radius: 4px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.03em;
}
body #app .label-editor-done-btn:hover {
    background: rgba(59, 130, 246, 0.08);
}

/* 2. MAIN AREA */
body #app .notes-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Close sidebar button hidden on desktop */
body #app .close-sidebar-btn {
    display: none;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
}

/* Header */
body #app .notes-header {
    flex-shrink: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    display: flex;
    align-items: center;
    padding: 0 16px;
}

/* Burger button — desktop hidden, mobile only */
body #app .menu-toggle-btn {
    display: none;
}

/* Search Box - Flex aligned, NOT absolute */
body #app .notes-header .search-box {
    flex: 1;
    max-width: 720px;
    height: 48px;
    margin-top: 10px;
    background: #f1f3f4;
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    transition: background 0.2s, box-shadow 0.2s, border 0.2s;
    border: 1px solid transparent;
}
.dark-mode body #app .notes-header .search-box,
[data-theme="dark"] body #app .notes-header .search-box {
    background: var(--bg-input);
}
[data-theme="neon"] body #app .notes-header .search-box {
    background: #000000;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 0 10px rgba(252, 238, 9, 0.05);
}
body #app .notes-header .search-box:focus-within {
    background: var(--bg-card);
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
[data-theme="neon"] body #app .notes-header .search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(252, 238, 9, 0.2);
    background: #050508;
}
body #app .notes-header .search-box i {
    font-size: 20px;
    color: var(--text-muted);
    margin-right: 12px;
}
body #app .notes-header .search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    outline: none;
    font-size: 16px;
}

body #app .notes-header .search-box {
    margin: 10px auto 10px auto;
}

/* 3. CONTENT AREA & CREATION BAR */
body #app .notes-coan-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

body #app .create-note-row {
    width: 100%;
    max-width: 600px;
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
}

body #app .create-note-box {
    flex: 1;
    height: 50px;
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color, #e0e0e0);
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3);
    padding: 0 16px;
    gap: 12px;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 600;
    transition: box-shadow 0.2s, background 0.2s, border-color 0.2s;
}

[data-theme="neon"] body #app .create-note-box {
    border-radius: 2px;
    background: var(--bg-panel);
    border: 1px solid transparent;
    box-shadow: 0 0 0 1px var(--hud-line);
    color: var(--text-main);
}

[data-theme="neon"] body #app .create-note-box:hover {
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2), inset 0 0 0 2px var(--info);
}
body #app .create-note-box i {
    font-size: 20px;
}
body #app .create-note-box:hover { 
    box-shadow: 0 2px 6px 0 rgba(60,64,67,0.3);
    color: var(--text-main);
}

body #app .notes-content {
    width: 100%;
    max-width: 1400px;
}

body #app .section-title {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    margin: 0 0 16px 8px;
    font-weight: 600;
}

/* 4. MASONRY GRID - CORRECT FIREFOX/CHROME COMPATIBLE CSS GRID */
body #app .notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    grid-auto-rows: 10px; /* Required for the JS resizeGridItem logic */
    align-items: start;
    margin-bottom: 32px;
}

/* ═══════════════════════════════════════
   RESPONSIVE — Mobile (≤ 768px)
   ═══════════════════════════════════════ */
@media (max-width: 768px) {

    /* Burger button appears on mobile */
    body #app .menu-toggle-btn {
        display: flex;
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        color: var(--text-muted);
        font-size: 20px;
        margin-right: 8px;
        border-radius: 50%;
        background: transparent;
        border: none;
        cursor: pointer;
        flex-shrink: 0;
    }
    body #app .menu-toggle-btn:hover {
        background: rgba(0,0,0,0.05);
    }

    /* Sidebar hidden by default, slides in */
    body #app .notes-sidebar {
        position: fixed;
        left: -300px;
        top: 60px;
        height: calc(100vh - 60px);
        z-index: 500;
        width: 280px;
        transition: left 0.3s ease;
        box-shadow: none;
    }
    body #app .notes-sidebar.active {
        left: 0;
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    }

    /* Main takes full width */
    body #app .notes-main {
        width: 100%;
        min-width: 0;
    }

    /* Hide sidebar close button only on desktop (show it on mobile) */
    body #app .close-sidebar-btn {
        display: flex !important;
    }

    /* "Nouvelle note" + "Nouvelle liste" = 50%/50% */
    body #app .create-note-row {
        flex-direction: row;
        gap: 8px;
    }
    body #app .create-note-box {
        flex: 1;
        min-width: 0;
    }

    /* Notes grid single column on small screens */
    body #app .notes-grid {
        grid-template-columns: 1fr;
    }

    /* Sidebar backdrop */
    body #app .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 499;
    }
}

body #app .note-card {
    background-color: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color, #e0e0e0);
    padding: 16px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
    cursor: pointer;
    overflow: hidden; /* required for themes */
    transition: box-shadow 0.2s, opacity 0.15s, transform 0.2s;
}

[data-theme="neon"] body #app .note-card {
    border-radius: 2px;
    background: var(--bg-panel);
    border: 1px solid transparent;
    box-shadow: inset 0 0 0 1px var(--border-color);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}

[data-theme="dark"] body #app .note-card::before,
[data-theme="neon"] body #app .note-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: inherit;
    background-image: inherit;
    filter: brightness(0.8) contrast(1.1) saturate(1.2);
    z-index: 0;
    pointer-events: none;
}

[data-theme="dark"] body #app .note-card > *,
[data-theme="neon"] body #app .note-card > * {
    position: relative;
    z-index: 1;
}

[data-theme="neon"] body #app .note-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(252, 238, 9, 0.15), inset 0 0 0 2px var(--primary);
}

/* ==========================================
   DRAG & DROP — Google Keep style
   ========================================== */

/* Ghost: invisible placeholder where the card was */
body #app .note-card.is-drag-ghost {
    opacity: 0;
    pointer-events: none;
}

/* Block text selection on all elements during drag */
body.is-dragging-note * {
    user-select: none !important;
    -webkit-user-select: none !important;
}

/* Floating clone that follows the cursor */
body #app .is-dragging-clone {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    transform: scale(1.04) rotate(1deg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
    opacity: 0.96;
    border-radius: 8px;
    cursor: grabbing;
}

body #app .note-card:hover {
    box-shadow: 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

body #app .note-card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--text-main);
}
[data-theme="neon"] body #app .note-card-title {
    color: #ffffff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}
body #app .is-placeholder-title {
    color: var(--text-muted);
    font-weight: 500;
    font-style: italic;
}
[data-theme="neon"] body #app .is-placeholder-title {
    color: rgba(255, 255, 255, 0.5);
}

body #app .note-content-html {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-main);
    word-break: break-word;
    max-height: calc(1.5em * 15);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 15;
    -webkit-box-orient: vertical;
}
body #app .note-content-html p {
    margin-bottom: 8px;
}

body #app .note-hover-actions {
    position: absolute;
    bottom: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    gap: 8px;
}
body #app .note-card:hover .note-hover-actions {
    opacity: 1;
}
body #app .note-hover-actions .icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: none;
    cursor: pointer;
}
body #app .note-hover-actions .icon-btn:hover {
    color: var(--text-main);
    background: white;
}

/* 5. MODAL */
body #app .note-modal-overlay { 
    z-index: 5000; 
    backdrop-filter: blur(2px); 
    background: rgba(0,0,0,0.4);
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

body #app .note-modal {
    background-color: var(--bg-modal, var(--bg-card)); 
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    width: 95%; max-width: 650px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

body #app .note-modal-header {
    padding: 16px 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body #app .note-modal-header .note-input.title {
    background: transparent; 
    border: none; 
    outline: none;
    font-size: 1.25rem; 
    font-weight: 600;
    color: var(--text-main); 
    width: 100%;
}

body #app .note-modal .modal-close-btn {
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(0,0,0,0.06); 
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}
body #app .note-modal .modal-close-btn:hover {
    background: rgba(0,0,0,0.1);
    color: var(--text-main);
}
.dark-mode body #app .note-modal .modal-close-btn {
    background: rgba(255,255,255,0.1);
}

body #app .note-modal-body {
    padding: 16px 20px;
}

/* Editor & Checklist sizing constraints */
body #app .quill-editor-container .ql-editor {
    min-height: 120px;
    max-height: 360px;
    overflow-y: auto;
}
body #app .checklist-container {
    min-height: 120px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 4px;
}

body #app .note-actions {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-top: 1px solid var(--border-color, #e0e0e0);
}

/* VALIDER BUTTON */
body #app .note-modal .btn-primary-sm {
    background: var(--primary, #1a73e8); 
    color: #ffffff; 
    padding: 8px 24px; 
    border-radius: 6px; 
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}
body #app .note-modal .btn-primary-sm:hover {
    background: var(--primary-hover, #1557b0);
}

/* CHECKLIST & OTHERS */
body #app .checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    margin-bottom: 2px;
    border-top: 1px solid transparent;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}
body #app .checklist-item:hover,
body #app .checklist-item:focus-within {
    border-top-color: var(--border-color, #f0f0f0);
    border-bottom-color: var(--border-color, #f0f0f0);
}

body #app .checklist-drag-handle {
    color: var(--text-muted, #9aa0a6);
    cursor: grab;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 16px;
    width: 16px;
    display: flex; align-items: center; justify-content: center;
}
body #app .checklist-item:hover .checklist-drag-handle,
body #app .checklist-item:focus-within .checklist-drag-handle {
    opacity: 1;
}

body #app .checklist-checkbox {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted, #5f6368);
    font-size: 18px;
    margin: 0;
}
body #app .checklist-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    margin: 0;
}
body #app .checklist-checkbox:hover {
    color: var(--text-main, #202124);
}
body #app .checklist-item.checked .checklist-checkbox {
    color: var(--text-muted, #5f6368); /* checked icon color */
}

body #app .checklist-item-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: var(--text-main, #202124);
    padding: 4px 0;
}
body #app .checklist-item.checked .checklist-item-input {
    text-decoration: line-through;
    color: var(--text-muted, #9aa0a6);
}

body #app .checklist-item-delete {
    background: transparent;
    border: none;
    color: var(--text-muted, #9aa0a6);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
    font-size: 18px;
    padding: 4px;
    display: flex; 
    align-items: center; 
    justify-content: center;
}
body #app .checklist-item:hover .checklist-item-delete,
body #app .checklist-item:focus-within .checklist-item-delete {
    opacity: 1;
}
body #app .checklist-item-delete:hover {
    color: var(--text-main, #202124);
}

body #app .checklist-add {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    margin-left: 24px; /* Align with checkboxes past the 16+8px drag handle & gap */
    color: var(--text-muted, #5f6368);
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s;
}
body #app .checklist-add:hover {
    color: var(--text-main, #202124);
}
body #app .checklist-add i {
    font-size: 18px;
}

body #app .checklist-completed-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0 8px;
    margin-left: 24px;
    color: var(--text-muted, #5f6368);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    user-select: none;
}
body #app .checklist-completed-divider:hover {
    color: var(--text-main, #202124);
}
body #app .checklist-completed-divider i {
    font-size: 18px;
}

body #app .checklist-preview-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 4px;
}
body #app .checklist-preview-item i {
    color: var(--text-muted);
}

/* 6. LABEL CHIPS */
body #app .note-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
body #app .modal-labels {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end; /* Push chips to right */
    gap: 8px;
    margin-top: 16px;
}
body #app .add-label-modal-box {
    margin-right: auto; /* Push add button to far left */
    order: -1;          /* Place add button first visually */
    display: flex;
    align-items: center;
    gap: 8px;
}
body #app .add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 16px;
    background: transparent;
    border: 1px solid var(--border-color, #e0e0e0);
    color: var(--text-main);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
body #app .add-btn:hover {
    background: rgba(0,0,0,0.05);
}
body #app .modal-label-input {
    border: 1px solid var(--primary, #1a73e8);
    background: transparent;
    border-radius: 12px;
    outline: none;
    font-size: 13px;
    padding: 6px 12px;
    width: 140px;
    color: var(--text-main);
}
body #app .btn-icon-sm {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--success, #10b981);
    color: white;
    border: none;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
}
body #app .label-chip {
    font-size: 12px;
    background: rgba(0,0,0,0.05);
    padding: 4px 10px;
    border-radius: 12px;
    color: var(--text-main);
}
body #app .label-chip.selectable {
    background: transparent;
    border: 1px solid var(--border-color, #e0e0e0);
    cursor: pointer;
    transition: all 0.2s;
}
body #app .label-chip.selectable:hover {
    background: rgba(0,0,0,0.05);
}
body #app .label-chip.selectable.selected {
    background: var(--primary, #1a73e8);
    color: white;
    border-color: var(--primary, #1a73e8);
}
.dark-mode body #app .label-chip {
    background: rgba(255,255,255,0.1);
}

/* THEMES */
body #app .color-picker { display: flex; gap: 24px; }
body #app .color-picker-group { display: flex; flex-direction: column; gap: 8px; }
body #app .picker-group-label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
body #app .color-picker-circles { display: flex; gap: 8px; flex-wrap: wrap; max-width: 220px; }
body #app .color-circle { 
    width: 28px; height: 28px; border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
body #app .color-circle.is-theme {
    background-size: 250% !important;
    background-position: bottom right !important;
    border: 2px solid rgba(0, 0, 0, 0.1);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    overflow: hidden;
}
body #app .color-circle.is-theme:hover {
    background-size: 300% !important;
}
.dark-mode body #app .color-circle { border-color: rgba(255,255,255,0.1); }

/* ASSETS (Cat, Dog, etc. bg logic) */
body #app .note-card.has-theme, body #app .note-modal.has-theme {
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
}
body #app .note-card.has-theme::after, body #app .note-modal.has-theme::after { 
    content: ''; position: absolute; inset: 0; background: rgba(255,255,255,0.45); z-index: 1; pointer-events: none; 
}
.dark-mode body #app .note-card.has-theme::after, .dark-mode body #app .note-modal.has-theme::after { 
    background: rgba(0,0,0,0.55); 
}
body #app .note-card.has-theme > *, body #app .note-modal.has-theme > * { 
    position: relative; z-index: 2; 
}

/* Enforce strict image mapping with !important to overpower lingering legacy shorthand */
.theme-cat { background-image: url('../../images/themes/cat.png') !important; }
.theme-dog { background-image: url('../../images/themes/dog.png') !important; }
.theme-food { background-image: url('../../images/themes/food.png') !important; }
.theme-places { background-image: url('../../images/themes/places.png') !important; }
.theme-travel { background-image: url('../../images/themes/travel.png') !important; }
.theme-music { background-image: url('../../images/themes/music.png') !important; }
.theme-nature { background-image: url('../../images/themes/nature.png') !important; }
.theme-tech { background-image: url('../../images/themes/tech.png') !important; }
.theme-art { background-image: url('../../images/themes/art.png') !important; }
.theme-chick { background-image: url('../../images/themes/chick.png') !important; }
