* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    --bg-primary: #e8eaed;
    --bg-secondary: #d6dade;
    --bg-tertiary: #cacfd5;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --border: #cdd4dc;
    --border-light: #e0e4e8;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #dde1e8 0%, #b0bece 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Zapobiega zoom na iOS przy focus input */
    touch-action: manipulation;
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.main-and-scratchpad {
    display: flex;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: 4px 0 16px rgba(0,0,0,0.10);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    flex-shrink: 0;
}

.logo-link {
    text-decoration: none;
    display: block;
    margin-bottom: 16px;
    transition: opacity 0.2s;
}

.logo-link:hover {
    opacity: 0.8;
}

.sidebar-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-new {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-weight: 600;
    font-size: 15px;
    box-shadow: var(--shadow-sm);
}

.btn-new:hover {
    box-shadow: var(--shadow-md);
}

.btn-icon {
    padding: 8px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Search */
.search-section {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-wrapper i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 14px;
}

.search-input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--bg-secondary);
    transition: all 0.2s;
    font-weight: 400;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

/* Filters */
.filters-section {
    padding: 20px 24px;
    flex: 1;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
}

.filter-group {
    margin-bottom: 0;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0;
}

.filter-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease-out;
    font-weight: 400;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-hint {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}

.tags-checkbox-container,
.priorities-checkbox-container {
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.tag-checkbox,
.priority-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease-out;
    border: 1px solid transparent;
    border-left: 3px solid;
    background: var(--bg-primary);
}

.tag-checkbox:hover,
.priority-checkbox:hover {
    background: var(--bg-secondary);
    border-color: var(--border);
    transform: translateX(2px);
}

.tag-checkbox input[type="checkbox"],
.priority-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 0;
    height: 0;
}

.tag-checkbox label,
.priority-checkbox label {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    cursor: pointer;
    padding-left: 28px;
    font-size: 13px;
    color: var(--text-primary);
}

.tag-checkbox label::before,
.priority-checkbox label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    transition: all 0.2s;
}

.tag-checkbox input[type="checkbox"]:checked ~ label::before,
.priority-checkbox input[type="checkbox"]:checked ~ label::before {
    background: var(--primary);
    border-color: var(--primary);
}

.tag-checkbox input[type="checkbox"]:checked ~ label::after,
.priority-checkbox input[type="checkbox"]:checked ~ label::after {
    content: '✓';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    z-index: 1;
    pointer-events: none;
}

.tag-checkbox input[type="checkbox"]:checked ~ label .tag-color-indicator,
.priority-checkbox input[type="checkbox"]:checked ~ label .priority-color-indicator {
    transform: scale(1.15);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.tag-color-indicator,
.priority-color-indicator {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-right: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    flex-shrink: 0;
    transition: all 0.2s ease-out;
}

.tag-name,
.priority-name {
    flex: 1;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-primary);
}

/* Main Content */
.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: transparent;
}

/* Podręczny notatnik - panel z prawej */
.scratchpad-panel {
    width: 60%;
    max-width: 720px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 60px);
    border-left: 1px solid var(--border);
    box-shadow: -4px 0 16px rgba(0,0,0,0.08);
    transition: width 0.25s ease, min-width 0.25s ease, opacity 0.2s ease;
    overflow: hidden;
}

.scratchpad-panel.collapsed {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
}

.scratchpad-panel.collapsed .scratchpad-body,
.scratchpad-panel.collapsed .scratchpad-toolbar {
    display: none;
}

.scratchpad-panel.collapsed .scratchpad-title {
    display: none;
}

.scratchpad-panel.collapsed .scratchpad-header {
    padding: 12px;
    justify-content: center;
}

.scratchpad-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    flex-shrink: 0;
}

.scratchpad-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.scratchpad-title:hover {
    color: var(--primary);
}

.scratchpad-toggle {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.scratchpad-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}

.scratchpad-panel.collapsed .scratchpad-toggle i {
    transform: rotate(180deg);
}

.scratchpad-panel.collapsed .scratchpad-toggle {
    margin: 0 auto;
}

.scratchpad-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 12px;
}

.scratchpad-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 5px 10px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

/* Wszystkie przyciski: identyczny box, ta sama czcionka, CSS robi formatowanie */
.sp-btn {
    width: 30px;
    height: 27px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-weight: 400;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
    user-select: none;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

/* Formatowanie tylko przez CSS, nie przez HTML-tagi w środku */
.sp-btn[data-command="bold"]          { font-weight: 800; }
.sp-btn[data-command="italic"]        { font-style: italic; }
.sp-btn[data-command="underline"]     { text-decoration: underline; text-underline-offset: 2px; }
.sp-btn[data-command="strikeThrough"] { text-decoration: line-through; }

.sp-hr-btn { font-size: 18px; letter-spacing: -1px; }

.sp-btn:hover {
    background: var(--bg-primary);
    color: var(--primary);
    border-color: var(--border);
}

.sp-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.sp-sep {
    width: 1px;
    height: 16px;
    background: var(--border);
    margin: 0 3px;
    flex-shrink: 0;
}

.scratchpad-textarea,
.scratchpad-editor {
    flex: 1;
    min-height: 200px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    font-family: inherit;
    background: #d2d6db;
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.scratchpad-editor {
    overflow-y: auto;
}

.scratchpad-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
}

.scratchpad-editor:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.scratchpad-editor img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    vertical-align: middle;
}

.scratchpad-editor hr {
    border: none;
    border-top: 2px solid rgba(0, 0, 0, 0.35);
    margin: 10px 0;
}

.scratchpad-editor ul, .scratchpad-editor ol {
    padding-left: 20px;
    margin: 4px 0;
}

.scratchpad-editor li {
    margin-bottom: 2px;
}

.scratchpad-editor strong { font-weight: 700; }
.scratchpad-editor em { font-style: italic; }
.scratchpad-editor u { text-decoration: underline; }
.scratchpad-editor s { text-decoration: line-through; color: var(--text-muted); }

/* Resizable images in editor and scratchpad */
.resizable-image-wrapper {
    display: inline-block;
    position: relative;
    max-width: 100%;
    vertical-align: middle;
    margin: 6px 0;
}

.resizable-image-wrapper[contenteditable="false"] {
    user-select: none;
}

.resizable-image-wrapper img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    vertical-align: middle;
}

.resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 20px;
    height: 20px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, var(--primary) 50%);
    background-size: 12px 12px;
    background-position: 100% 100%;
    border-radius: 0 0 var(--radius) 0;
    opacity: 0.7;
}

.resize-handle:hover {
    opacity: 1;
}

.note-content-editor .resizable-image-wrapper,
.scratchpad-editor .resizable-image-wrapper {
    display: inline-block;
}

.scratchpad-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.scratchpad-status {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    min-height: 18px;
}

.scratchpad-panel.collapsed + .main-content {
    /* gdy notatnik zwinięty, main zajmuje całość - brak zmiany, main ma flex:1 */
}

.view-header {
    padding: 24px 32px;
    background: rgba(236, 238, 241, 0.93);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.view-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.view-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.priority-separator-control {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.filter-group .separator-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: all 0.2s ease-out;
}

.filter-group .separator-toggle-label:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
}

.separator-toggle {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    transition: background 0.3s;
    border: 2px solid var(--border);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    top: 1px;
    left: 1px;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.separator-toggle:checked + .toggle-slider {
    background: var(--primary);
    border-color: var(--primary);
}

.separator-toggle:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-text {
    font-weight: 500;
    color: var(--text-primary);
}

/* Separator między grupami priorytetów */
.priority-separator {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
    padding: 0 16px;
    animation: separatorFadeIn 0.4s ease-out;
}

.notes-grid .priority-separator {
    grid-column: 1 / -1;
    margin: 16px 0;
}

.notes-list .priority-separator {
    width: 100%;
    margin: 12px 0;
}

@keyframes separatorFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.separator-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--border) 20%, 
        var(--primary) 50%, 
        var(--border) 80%, 
        transparent 100%);
    border-radius: 1px;
}

.separator-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    white-space: nowrap;
    border: 1px solid var(--border);
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.separator-priority-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    border: 1px solid;
    min-width: 32px;
}

.notes-count {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.priority-select-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.priority-select-wrapper label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Notes List View Container */
.notes-list-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Notes Grid */
.notes-grid {
    padding: 24px 32px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    overflow-y: auto;
    flex: 1;
    height: 100%;
}

.notes-grid .priority-separator {
    grid-column: 1 / -1;
    margin: 16px 0;
}

/* Notes List View */
.notes-list {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
}

.notes-list .priority-separator {
    width: 100%;
    margin: 12px 0;
}

.notes-list .note-card {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 12px 16px;
    gap: 12px;
    min-height: auto;
}

.notes-list .note-card-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.notes-list .note-card-title {
    margin: 0;
    font-size: 16px;
    line-height: 1.3;
}

.notes-list .note-card-content {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    max-height: 3em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notes-list .note-card-image {
    flex: 0 0 80px;
    margin: 0;
    max-width: 80px;
    height: 60px;
    overflow: hidden;
    border-radius: var(--radius-sm);
}

.notes-list .note-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notes-list .note-card-footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
}

.notes-list .note-card-tags {
    flex-wrap: wrap;
    gap: 4px;
}

.notes-list .note-card-tags .tag {
    font-size: 11px;
    padding: 2px 6px;
}

.notes-list .note-card-date {
    font-size: 11px;
    margin-top: 4px;
}

.notes-list .note-card-actions {
    flex-shrink: 0;
}

/* Drag Gap */
.drag-gap {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(129, 140, 248, 0.2) 100%);
    border: 2px dashed var(--primary);
    border-radius: var(--radius-lg);
    margin: 8px 0;
    transition: height 0.2s ease-out;
    overflow: hidden;
    position: relative;
}

.drag-gap::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.4), transparent);
    animation: shimmer 1.5s infinite;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: var(--radius);
    margin-right: 16px;
}

.view-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-toggle-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.view-toggle-btn.active {
    background: var(--primary);
    color: white;
}

.view-toggle-btn.active:hover {
    background: var(--primary-dark);
}

.note-card {
    background: #e0e4e9;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: transform 0.15s ease-out,
                box-shadow 0.15s ease-out,
                opacity 0.2s ease-out,
                border-left-color 0.2s ease-out,
                background 0.2s ease-out;
    position: relative;
    display: flex;
    gap: 12px;
    will-change: transform, opacity;
}

.note-card-content-wrapper {
    flex: 1;
    min-width: 0;
}

.note-card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 4px 0;
}

.note-card-actions-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    position: relative;
    z-index: 50;
    pointer-events: auto;
}

.btn-delete-inline {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    padding: 0;
}

.btn-delete-inline:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    transform: scale(1.1);
}


.note-card-tags-row {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

.btn-move {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 12px;
    padding: 0;
}

.btn-move:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.1);
}

.btn-move:active {
    transform: scale(0.95);
}

.priority-select-inline {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    min-width: 50px;
}

.priority-select-inline:hover {
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.priority-select-inline:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.priority-select-unified {
    padding: 8px 36px 8px 14px;
    border: 2px solid;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 70px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    display: inline-block;
    white-space: nowrap;
    user-select: none;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
    will-change: transform, box-shadow;
    background-color: var(--bg-primary);
    font-family: inherit;
}

.priority-select-unified option {
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
    font-family: inherit;
}

.priority-select-unified:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.priority-select-unified:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.priority-select-unified:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Delikatne animacje zmiany priorytetu */
.note-card.priority-updating {
    animation: priorityUpdating 0.3s ease-out;
}

.note-card.priority-updated {
    animation: priorityUpdated 0.5s ease-out;
}

@keyframes priorityUpdating {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.98);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes priorityUpdated {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(99, 102, 241, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

/* Płynne przejścia dla elementów karty */
.priority-badge {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.priority-select-inline {
    transition: all 0.2s ease-out;
}

.note-card {
    transition: border-left-color 0.3s ease-out, 
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease-out;
}

/* Animacja przesuwania pozycji */
.note-card {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s ease-out,
                box-shadow 0.3s ease-out;
}

.notes-grid .note-card,
.notes-list .note-card {
    animation: slideIn 0.4s ease-out backwards;
}

.notes-grid .note-card:nth-child(1),
.notes-list .note-card:nth-child(1) {
    animation-delay: 0.05s;
}

.notes-grid .note-card:nth-child(2),
.notes-list .note-card:nth-child(2) {
    animation-delay: 0.1s;
}

.notes-grid .note-card:nth-child(3),
.notes-list .note-card:nth-child(3) {
    animation-delay: 0.15s;
}

.notes-grid .note-card:nth-child(4),
.notes-list .note-card:nth-child(4) {
    animation-delay: 0.2s;
}

.notes-grid .note-card:nth-child(n+5),
.notes-list .note-card:nth-child(n+5) {
    animation-delay: 0.25s;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
    border-left-width: 5px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.note-card:active {
    cursor: grabbing;
}

.note-card[style*="border-left-color"] {
    border-left-width: 5px !important;
    border-left-style: solid !important;
}

/* Wzmocnij widoczność kolorów */
.note-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    z-index: 0;
}

.note-card[style*="border-left-color"]::after {
    background: inherit;
    border-left-color: inherit;
}

/* Drag handle usunięty - przeciąganie z całej karty */

.note-card[draggable="true"] {
    cursor: grab;
    -webkit-user-drag: element;
}

.note-card[draggable="true"]:active {
    cursor: grabbing;
}

.note-card.dragging {
    opacity: 0.5 !important;
    transform: scale(0.98);
    pointer-events: none;
    cursor: grabbing !important;
}

.note-card.drag-over {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3) !important;
    transform: translateY(-3px) scale(1.01);
    background: rgba(99, 102, 241, 0.05) !important;
}

.drag-placeholder {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(129, 140, 248, 0.15) 100%);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--primary);
    margin: 12px 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    animation: placeholderPulse 1.5s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.drag-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes placeholderPulse {
    0%, 100% {
        opacity: 0.4;
        border-color: var(--primary);
    }
    50% {
        opacity: 0.7;
        border-color: var(--primary-light);
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.note-card.drag-over {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.note-card.drag-over::before {
    transform: scaleX(1);
    background: var(--primary);
}


.note-card.drag-over-before {
    border-color: var(--primary) !important;
    transform: translateY(-10px) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25) !important;
    transition: transform 0.2s ease-out !important;
}

.note-card.drag-over-after {
    border-color: var(--primary) !important;
    transform: translateY(10px) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25) !important;
    transition: transform 0.2s ease-out !important;
}

.note-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-accent-color, var(--primary));
    transform: scaleX(0);
    transition: transform 0.2s;
    z-index: 1;
}

.note-card:hover {
    background: #d6dbe2;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.15), 0 4px 8px -2px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-light);
}

.note-card:hover::before {
    transform: scaleX(1);
}

.note-card:active {
    transform: translateY(0);
    box-shadow: 0 4px 8px -2px rgba(0, 0, 0, 0.1);
}

/* Priorytety są teraz dynamiczne na podstawie koloru */

.note-card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.3px;
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
    padding: 0;
}

.note-card-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    border-radius: var(--radius);
    margin-top: 12px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.note-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.note-card:hover .note-card-image img {
    transform: scale(1.05);
}

.note-card-content {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    min-height: 70px;
    position: relative;
    z-index: 1;
}

.note-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    gap: 12px;
    flex-wrap: wrap;
}

.note-card-footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}

.note-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.tag {
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    border: 1px solid currentColor;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tag:hover {
    transform: scale(1.08);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.tag .remove-tag {
    cursor: pointer;
    opacity: 0.7;
}

.tag .remove-tag:hover {
    opacity: 1;
}

.priority-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: inline-block;
    border: 1px solid currentColor;
}

.status-badge {
    padding: 8px 36px 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    display: inline-block;
    border: 2px solid;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='currentColor' d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    user-select: none;
    white-space: nowrap;
    cursor: pointer;
    appearance: none;
    min-width: 70px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
    will-change: transform, box-shadow;
    font-family: inherit;
}

.status-badge option {
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
    font-family: inherit;
}

.status-badge.status-todo {
    color: #b45309;
    border-color: #f59e0b;
    background-color: rgba(245, 158, 11, 0.12);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23b45309' d='M8 11L3 6h10z'/%3E%3C/svg%3E");
}

.status-badge.status-info {
    color: #1e40af;
    border-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.12);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%231e40af' d='M8 11L3 6h10z'/%3E%3C/svg%3E");
}

.status-badge.status-done {
    color: #047857;
    border-color: #10b981;
    background-color: rgba(16, 185, 129, 0.12);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23047857' d='M8 11L3 6h10z'/%3E%3C/svg%3E");
}

.status-badge:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.status-badge:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.status-badge:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.status-updating {
    opacity: 0.6;
    pointer-events: none;
}

.note-card-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.note-card-date::before {
    content: '🕒';
    font-size: 11px;
    opacity: 0.7;
}

.note-card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.note-card-actions .btn-icon {
    padding: 8px;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Editor */
.note-editor-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-primary);
}

.editor-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(20px);
    background: rgba(236, 238, 241, 0.93);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    gap: 16px;
}

.editor-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.editor-header-left .btn-back,
.editor-header-left .btn-delete-header,
.editor-header-left .btn-save-header {
    flex-shrink: 0;
}

.editor-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.editor-header-date {
    display: flex;
    align-items: center;
    gap: 8px;
}

.note-created-date-input {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s;
}

.note-created-date-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.btn-save-header,
.btn-delete-header {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius);
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-back {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-back:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
    border-color: var(--primary);
    transform: translateX(-2px);
}

.editor-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.priority-select {
    padding: 8px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--bg-primary);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    flex: 1;
    min-width: 120px;
}

.priority-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.editor-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
}

.editor-main-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.editor-meta-row {
    display: flex;
    gap: 20px;
    align-items: center;
    margin: 0 0 20px 0;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.sidebar-view-controls {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.sidebar-view-controls .view-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.sidebar-view-controls .notes-count-wrapper {
    text-align: center;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: rgba(236, 238, 241, 0.93);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    gap: 16px;
}


.editor-header-date {
    display: flex;
    align-items: center;
    gap: 8px;
}

.note-created-date-input {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s;
}

.note-created-date-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.btn-save-header,
.btn-delete-header {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius);
    transition: all 0.2s;
    white-space: nowrap;
}

.note-title-input {
    width: 100%;
    padding: 16px 0;
    border: none;
    border-bottom: 2px solid var(--border);
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    background: transparent;
    margin: 0 0 20px 0;
    transition: all 0.2s;
}

.note-title-input:focus {
    outline: none;
    border-bottom-color: var(--primary);
    border-bottom-width: 3px;
}

.note-title-input::placeholder {
    color: var(--text-muted);
}

.tags-section {
    margin: 0 0 20px 0;
    padding: 0 0 20px 0;
    border-bottom: 1px solid var(--border-light);
}

.tags-section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-input-hint {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}

/* Editor Toolbar */
.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 0 0 20px 0;
    flex-wrap: wrap;
}

.toolbar-btn {
    padding: 8px 12px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
}

.toolbar-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    color: var(--primary);
}

.toolbar-btn:active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 4px;
}

.tags-display {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 10px 0;
}

.tag-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.tag-input-wrapper i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
}

.tag-input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg-secondary);
    transition: all 0.2s;
}

.tag-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.tag-input-wrapper {
    position: relative;
}

.tag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    display: none;
}

.tag-suggestion {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.tag-suggestion:hover {
    background: var(--bg-secondary);
}

.priority-section-editor,
.status-section-editor {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.priority-section-editor label,
.status-section-editor label {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 70px;
    font-size: 14px;
    margin: 0;
}

.status-select {
    padding: 8px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--bg-primary);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    flex: 1;
    min-width: 120px;
}

.status-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.save-button-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid var(--border);
}

.btn-save-bottom {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease-out;
}

.btn-save-bottom:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.priority-filter-options {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    padding: 0;
}

.priority-filter-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease-out;
}

.priority-filter-option:hover {
    background: var(--bg-secondary);
}

.priority-filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

.btn-filter-all,
.btn-filter-clear {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-out;
}

.btn-filter-all:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.btn-filter-clear:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.tag-filter-options {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    padding: 0;
}

.tag-filter-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease-out;
}

.tag-filter-option:hover {
    background: var(--bg-secondary);
}

.tag-filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

.status-filter-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    max-height: 200px;
    overflow-y: auto;
}

.status-filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease-out;
    font-size: 12px;
    font-weight: 500;
}

.status-filter-option:hover {
    background: var(--bg-tertiary);
    border-color: var(--border);
}

.status-filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

.login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-content {
    background: var(--bg-primary);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.login-content h2 {
    margin-bottom: 24px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
}

.login-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    cursor: pointer;
    font-size: 14px;
}

.btn-login {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-login:active {
    transform: translateY(0);
}

.login-error {
    color: var(--danger);
    font-size: 13px;
    margin-top: 12px;
    text-align: center;
    min-height: 20px;
    display: none;
}

.login-error {
    color: var(--danger);
    font-size: 13px;
    margin-top: 12px;
    display: none;
}

.date-filter-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.date-filter-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s ease-out;
    font-family: inherit;
}

.date-filter-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.date-filter-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
}

.date-filter-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.note-content-editor {
    min-height: 500px;
    padding: 24px;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 16px;
    line-height: 1.9;
    outline: none;
    background: var(--bg-primary);
    color: var(--text-primary);
    margin: 0 0 20px 0;
    transition: all 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.note-content-editor:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: #fafbff;
}

.note-content-html-editor {
    display: none;
    width: 100%;
    min-height: 500px;
    padding: 24px;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    background: var(--bg-primary);
    color: var(--text-primary);
    margin: 0 0 20px 0;
    outline: none;
    transition: all 0.2s;
}

.note-content-html-editor:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.note-content-editor:empty:before {
    content: attr(placeholder);
    color: var(--text-muted);
}

.note-content-editor img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 16px 0;
    box-shadow: var(--shadow-md);
}

.note-content-editor p {
    margin: 12px 0;
}

.note-content-editor ul,
.note-content-editor ol {
    margin: 12px 0;
    padding-left: 24px;
    list-style-position: outside;
}

.note-content-editor ul li {
    margin-bottom: 6px;
    padding-left: 0;
    list-style: none;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.note-content-editor ul li input[type="checkbox"] {
    margin: 0;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    min-width: 18px;
    accent-color: var(--primary);
    pointer-events: auto;
}

.note-content-editor ul li input[type="checkbox"]:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.note-content-editor ul li > span {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
}

.note-content-editor h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 20px 0 12px 0;
    color: var(--text-primary);
}

.note-content-editor strong {
    font-weight: 700;
}

.note-content-editor em {
    font-style: italic;
}

.note-content-editor u {
    text-decoration: underline;
}

.note-images-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 0 0 20px 0;
}

.note-image {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    aspect-ratio: 1;
}

.note-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.note-image-error .note-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 80px;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.note-image-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.note-image-delete:hover {
    background: var(--danger);
    transform: scale(1.1);
}

.empty-state {
    text-align: center;
    padding: 100px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 80px;
    margin-bottom: 24px;
    opacity: 0.3;
    color: var(--primary);
}

.empty-state h2 {
    font-size: 28px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.empty-state p {
    font-size: 16px;
    color: var(--text-muted);
}

.hidden {
    display: none !important;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 350px;
    pointer-events: none;
}

.toast {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 14px 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid var(--primary);
    pointer-events: auto;
    font-size: 14px;
}

.toast-icon {
    font-weight: bold;
    font-size: 16px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-left-color: var(--success);
}

.toast-error {
    border-left-color: var(--danger);
}

.toast-warning {
    border-left-color: var(--warning);
}

.toast-info {
    border-left-color: var(--info);
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
    }
    
    .notes-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        height: 100vh;
        overflow: hidden;
    }
    
    .sidebar {
        width: 100%;
        max-height: 50vh;
        border-right: none;
        border-bottom: 1px solid var(--border);
        flex-shrink: 0;
    }
    
    .main-content {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .filters-section {
        max-height: calc(50vh - 200px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .notes-grid {
        grid-template-columns: 1fr;
        padding: 16px;
    }
    
    .notes-list {
        padding: 12px 16px;
        gap: 6px;
    }
    
    .notes-list .note-card {
        padding: 10px 12px;
        gap: 10px;
    }
    
    .notes-list .note-card-title {
        font-size: 14px;
    }
    
    .notes-list .note-card-content {
        font-size: 12px;
    }
    
    .notes-list .note-card-image {
        flex: 0 0 60px;
        max-width: 60px;
        height: 45px;
    }
    
    .editor-content {
        padding: 20px;
    }
    
    .note-title-input {
        font-size: 24px;
    }
    
    .editor-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .priority-separator-control {
        order: 3;
        width: 100%;
        margin-top: 8px;
    }
    
    .separator-toggle-label {
        font-size: 12px;
    }
    
    .toggle-slider {
        width: 40px;
        height: 22px;
    }
    
    .separator-toggle:checked + .toggle-slider::before {
        transform: translateX(18px);
    }
    
    .editor-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .tags-section {
        margin: 16px 0;
    }
    
    .tag-input-wrapper {
        position: relative;
    }
    
    .tag-suggestions {
        max-height: 200px;
        overflow-y: auto;
    }
    
    .priority-section-editor,
    .status-section-editor {
        margin: 12px 0;
    }
    
    .editor-toolbar {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .toolbar-btn {
        min-width: 36px;
    }
}

@media (max-width: 480px) {
    .login-content {
        padding: 24px 20px;
        max-width: 100%;
    }
    
    .login-content h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .login-input {
        padding: 14px 16px;
        font-size: 16px; /* Zapobiega zoom na iOS */
    }
    
    .btn-login {
        padding: 14px;
        font-size: 16px;
    }
    
    .sidebar-header {
        padding: 16px;
    }
    
    .sidebar-header h1 {
        font-size: 20px;
    }
    
    .btn-new {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .view-header {
        padding: 12px 16px;
    }
    
    .search-input {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .filters-section {
        padding: 12px 16px;
    }
    
    .filter-group {
        margin-bottom: 16px;
    }
    
    .filter-label {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .filter-select {
        font-size: 13px;
        padding: 8px;
    }
    
    .tag-checkbox {
        font-size: 12px;
        padding: 6px 8px;
    }
    
    .note-card {
        padding: 12px;
    }
    
    .note-card-title {
        font-size: 16px;
        margin-bottom: 6px;
    }
    
    .note-card-content {
        font-size: 13px;
        line-height: 1.5;
    }
    
    .note-card-actions {
        gap: 6px;
    }
    
    .btn-icon {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .editor-content {
        padding: 12px;
    }
    
    .note-title-input {
        font-size: 20px;
        padding: 12px;
    }
    
    .tags-section {
        margin: 16px 0;
    }
    
    .tag-input {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .note-content-editor {
        min-height: 250px;
        padding: 12px;
        font-size: 16px; /* Zapobiega zoom na iOS - minimum 16px */
    }
    
    .save-button-section {
        padding: 12px 0;
    }
    
    .btn-save-bottom {
        width: 100%;
        padding: 14px;
        font-size: 16px;
        margin-top: 12px;
    }
    
    .note-card-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .note-card-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .priority-select-inline {
        font-size: 12px;
        padding: 4px 6px;
    }
    
    .note-card-date {
        font-size: 11px;
        margin-top: 4px;
    }
    
    .tags-display {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .tag {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .remove-tag {
        font-size: 10px;
        padding: 2px 4px;
    }
    
    .editor-toolbar {
        padding: 8px;
        gap: 4px;
    }
    
    .toolbar-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .priority-select, .status-select {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .btn-save-bottom {
        width: 100%;
        padding: 14px;
        font-size: 16px;
        margin-top: 16px;
    }
    
    .btn-back {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .note-created-date {
        font-size: 11px;
    }
    
    .notes-list {
        padding: 8px 12px;
        gap: 4px;
    }
    
    .notes-list .note-card {
        padding: 8px 10px;
        gap: 8px;
    }
    
    .notes-list .note-card-title {
        font-size: 13px;
    }
    
    .notes-list .note-card-content {
        font-size: 11px;
        max-height: 2.5em;
        -webkit-line-clamp: 2;
    }
    
    .notes-list .note-card-image {
        flex: 0 0 50px;
        max-width: 50px;
        height: 40px;
    }
    
    .notes-list .note-card-tags .tag {
        font-size: 10px;
        padding: 1px 4px;
    }
    
    .priority-badge {
        font-size: 10px;
        padding: 2px 5px;
    }
    
    .btn-move {
        width: 22px;
        height: 22px;
        font-size: 9px;
    }
    
    .editor-content {
        padding: 16px;
    }
    
    .note-content-editor {
        min-height: 300px;
        padding: 16px;
    }
    
    .priority-select-unified,
    .status-badge {
        font-size: 13px;
        padding: 7px 32px 7px 12px;
        min-width: 65px;
    }
    
    .priority-select-unified {
        background-position: right 10px center;
        background-size: 13px;
    }
    
    .status-badge {
        background-position: right 10px center;
        background-size: 13px;
    }
    
    .priority-select-unified option,
    .status-badge option {
        padding: 8px 12px;
        font-size: 13px;
    }
}
