/* /var/www/securevault/styles.css
 * Последнее изменение: 2025-01-23
 * Причина: улучшение дизайна раздела заметок
 * Автор изменений: AndyBrok
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #6366F1;
    --secondary: #8B5CF6;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --light: #F8FAFC;
    --dark: #1E293B;
    --gray: #64748B;
    --border: #E2E8F0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-body: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-card: #FFFFFF;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --bg-hover: rgba(99, 102, 241, 0.05);
    --border-radius: 16px;
    --border-radius-lg: 24px;
}

[data-theme="dark"] {
    --primary: #8B5CF6;
    --secondary: #A78BFA;
    --success: #34D399;
    --danger: #F87171;
    --warning: #FBBF24;
    --info: #60A5FA;
    --light: #1E293B;
    --dark: #F1F5F9;
    --gray: #94A3B8;
    --border: #3D4A5C;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    --shadow-card: 0 2px 8px 0 rgba(0, 0, 0, 0.4);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-body: #0a0e1a;
    --bg-card: #151c2c;
    --bg-sidebar: #0d1220;
    --bg-header: #111827;
    --bg-widget: #1a2332;
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --bg-hover: rgba(139, 92, 246, 0.15);
    --border-radius: 16px;
    --border-radius-lg: 24px;
}

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

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    min-height: 100vh;
    color: var(--text-primary);
    transition: var(--transition);
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body:not([data-theme="dark"]) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

body:not([data-theme="dark"])::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
    pointer-events: none;
    z-index: -1;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-form {
    background: var(--bg-card);
    padding: 32px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 380px;
    color: var(--text-primary);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.login-form:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

#password-form, #note-form { padding: 16px 20px; }

.login-form h2 {
    text-align: center;
    margin-bottom: 24px;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.error-message {
    color: var(--danger);
    text-align: center;
    margin-top: 15px;
    font-weight: 500;
}

.header-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text-primary);
}

.theme-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: scale(1.05);
}

.theme-icon { transition: transform 0.3s ease; }

[data-theme="dark"] .theme-icon { transform: rotate(180deg); }

.icon-small { width: 16px; height: 16px; }

.password-input-group {
    display: flex;
    gap: 5px;
    align-items: stretch;
}

.password-input-group input { flex: 1; }

.password-input-group .btn { flex-shrink: 0; }

.generator-settings { margin: 20px 0; }

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] { margin-right: 8px; }

.checkmark {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 3px;
    margin-right: 8px;
    position: relative;
    transition: background 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 1px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.password-strength { margin-top: 8px; }

.strength-meter {
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 2px;
}

.strength-fill.very-weak { background: #dc3545; width: 20%; }
.strength-fill.weak { background: #fd7e14; width: 40%; }
.strength-fill.medium { background: #ffc107; width: 60%; }
.strength-fill.strong { background: #28a745; width: 80%; }
.strength-fill.very-strong { background: #20c997; width: 100%; }

.strength-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.search-filters {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 1;
    margin-right: 10px;
}

.search-input {
    flex: 1;
    width: 260px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: var(--transition);
    box-shadow: var(--shadow-card);
}

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

.search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.filter-select {
    padding: 8px 12px;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.filter-select:focus { outline: none; border-color: var(--primary); }

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.tag {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.category-badge {
    display: inline-block;
    background: var(--info);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 4px;
}

/* Красивый category-badge сверху карточки */
.category-badge-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 12px 12px 0 0;
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

/* Drag handle для перетаскивания */
.drag-handle {
    cursor: grab;
    user-select: none;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Иконка перетаскивания для карточек без категории */
.drag-handle-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border-radius: 6px;
    color: var(--text-secondary);
    opacity: 0.5;
    transition: var(--transition);
    z-index: 5;
}

.drag-handle-icon:hover {
    opacity: 1;
    background: var(--primary);
    color: white;
}

.drag-handle-icon svg {
    width: 14px;
    height: 14px;
}

/* Карточки без категории - добавляем отступ для иконки */
.item-card:has(.drag-handle-icon) .item-actions {
    top: 38px;
}


.keyboard-shortcuts-content {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.shortcuts-section { margin-bottom: 25px; }

.shortcuts-section h4 {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 5px;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.shortcut-item:last-child { border-bottom: none; }

.shortcut-item kbd {
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.8rem;
    font-family: monospace;
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.shortcut-item span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.tab-swipe-hint {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.tab-swipe-hint.show { opacity: 1; }

.view-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.view-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    font-size: 0.85rem;
}

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

.kanban-board {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
    min-height: 500px;
}

.kanban-board.active { display: grid; }

.kanban-column {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
}

.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

.kanban-column-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.task-count {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.kanban-column-content {
    min-height: 200px;
    max-height: 600px;
    overflow-y: auto;
    padding: 4px;
}

.kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: move;
    transition: all 0.2s ease;
}

.kanban-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.kanban-card.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.kanban-card .item-title {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.kanban-card .item-content {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.kanban-card .task-assignee {
    font-size: 0.8rem;
    font-weight: 500;
}

.kanban-card .task-deadline {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.kanban-card .task-deadline.overdue {
    color: var(--danger);
    font-weight: 600;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.dashboard-widget {
    background: var(--bg-widget, var(--bg-card));
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    overflow: hidden;
}

[data-theme="dark"] .dashboard-widget {
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.widget-header {
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
    border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .widget-header {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(99, 102, 241, 0.08) 100%);
}

.widget-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.widget-header h3 .icon-small {
    color: var(--primary);
}

.widget-content { padding: 14px 16px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 12px;
}

.stat-item {
    text-align: center;
    padding: 16px 12px;
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 80px;
}

[data-theme="dark"] .stat-item {
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

[data-theme="dark"] .stat-item:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.4);
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
    color: var(--primary);
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    font-size: 0.9rem;
}

.activity-type {
    font-weight: 600;
    color: var(--primary);
}

.activity-time {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-left: 8px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--text-primary);
}

[data-theme="dark"] .quick-action-btn {
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

[data-theme="dark"] .quick-action-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}

.quick-action-btn:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.quick-action-btn i { font-size: 1.5rem; }

.quick-action-btn span {
    font-size: 0.75rem;
    font-weight: 500;
}

.urgent-items {
    max-height: 200px;
    overflow-y: auto;
}

.urgent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.urgent-item:hover { background: rgba(220, 53, 69, 0.15); }

.urgent-item:last-child { margin-bottom: 0; }

.urgent-icon {
    color: var(--danger);
    flex-shrink: 0;
}

.urgent-content { flex: 1; }

.urgent-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.urgent-deadline {
    font-size: 0.8rem;
    color: var(--danger);
    margin-bottom: 4px;
}

.urgent-assignee {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
    opacity: 0.8;
}

.no-urgent-items {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    color: var(--success);
    font-weight: 500;
}

.note-editor-tabs {
    display: flex;
    background: var(--bg-card);
    border-radius: 6px 6px 0 0;
    overflow: hidden;
    margin: -20px -20px 20px -20px;
}

.editor-tab {
    flex: 1;
    padding: 10px 16px;
    background: var(--light);
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    color: var(--text-primary);
}

.editor-tab:hover { background: var(--bg-hover); }

.editor-tab.active {
    background: var(--primary);
    color: white;
}

.editor-container { position: relative; }

.editor-container textarea,
.note-preview {
    width: 100%;
    min-height: 300px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: 'Inter', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
}

.editor-container textarea {
    border: none;
    outline: none;
}

.note-preview {
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow-y: auto;
}

.note-preview h1,
.note-preview h2,
.note-preview h3,
.note-preview h4,
.note-preview h5,
.note-preview h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: var(--text-primary);
}

.note-preview h1 { font-size: 1.8em; border-bottom: 1px solid var(--border); padding-bottom: 0.3em; }
.note-preview h2 { font-size: 1.5em; border-bottom: 1px solid var(--border); padding-bottom: 0.3em; }
.note-preview h3 { font-size: 1.3em; }
.note-preview h4 { font-size: 1.1em; }

.note-preview p {
    margin-bottom: 1em;
    line-height: 1.6;
}

.note-preview ul,
.note-preview ol {
    margin-bottom: 1em;
    padding-left: 2em;
}

.note-preview li { margin-bottom: 0.5em; }

.note-preview code {
    background: var(--light);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.note-preview pre {
    background: var(--light);
    padding: 1em;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1em;
}

.note-preview pre code {
    background: none;
    padding: 0;
}

.note-preview blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1em;
    margin-left: 0;
    color: var(--text-secondary);
    font-style: italic;
}

.note-preview a {
    color: var(--primary);
    text-decoration: none;
}

.note-preview a:hover { text-decoration: underline; }

.note-preview table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1em;
}

.note-preview th,
.note-preview td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
}

.note-preview th {
    background: var(--light);
    font-weight: 600;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: var(--text-primary);
    font-size: 2.25rem;
    text-shadow: none;
    margin: 0;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Глобальный поиск скрыт - требует доработки */
.global-search {
    display: none !important;
}

.global-search .search-input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 24px;
    padding: 12px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-card);
}

.global-search .search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.8;
}

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

.nav-tabs {
    display: flex;
    background: var(--bg-card);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
    border-bottom: none;
}

.tab-btn {
    flex: 1;
    padding: 16px 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    position: relative;
}

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

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

.tab-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.tab-content {
    display: none;
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
    min-height: 500px;
    margin-top: 1rem;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.tab-content.active { 
    display: block; 
    /* Анимация убрана отсюда - теперь только через класс fade-in */
}

.tab-content.fade-out {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

.tab-content.fade-in {
    animation: fadeInTab 0.25s ease-out forwards;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    gap: 10px;
}

.section-header h2 {
    color: var(--dark);
    font-size: 1.2rem;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    min-height: 36px;
}

.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn:active { transform: translateY(1px); }

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

.btn-primary:hover {
    background: #5048E5;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: translateY(-1px);
}

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

.btn-danger:hover {
    background: #DC2626;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-warning {
    background: var(--warning);
    color: var(--dark);
    border: 1px solid rgba(255, 193, 7, 0.3);
    box-shadow: var(--shadow);
}

.btn-warning:hover {
    background: #D97706;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-small {
    padding: 8px 8px;
    font-size: 0.8rem;
    min-height: 0;
}

.items-list {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.item-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
    background: var(--bg-card);
}

[data-theme="light"] .item-card {
    background: #FFFFFF;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .item-card {
    background: #1a2332;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(139, 92, 246, 0.1);
}

/* Компактные карточки для паролей */
#passwords-list .item-card {
    padding: 14px;
}

/* Стили для item-actions в паролях */
#passwords-list .item-actions {
    top: 38px;
}

.item-card:last-child {
    margin-bottom: 0;
}

.item-card:hover {
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.4);
    background: var(--bg-card);
}

.item-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 10px;
    margin-bottom: 10px;
    line-height: 1.5;
    word-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.item-meta {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 8px;
    word-wrap: break-word;
    font-weight: 500;
}

.item-meta a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

.item-meta a:hover {
    color: var(--secondary);
    text-decoration: underline;
}

.item-content {
    color: var(--text-primary);
    line-height: 1.7;
    margin-top: 10px;
    margin-bottom: 16px;
    word-wrap: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    font-size: 0.875rem;
    opacity: 0.85;
    padding: 8px 0;
}

.item-actions {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
    z-index: 10;
    opacity: 0.7;
    transition: var(--transition);
    background: rgba(0, 0, 0, 0.05);
    padding: 4px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.item-card:hover .item-actions { 
    opacity: 1; 
    background: rgba(0, 0, 0, 0.1);
}

/* Специальные стили для item-actions в задачах */
#tasks-list .item-actions,
.kanban-card .item-actions,
.task-card .item-actions {
    position: absolute;
    top: 0px;
    right: 0px;
    display: flex;
    gap: 4px;
    z-index: 10;
    opacity: 0.7;
    transition: var(--transition);
    background: rgba(0, 0, 0, 0.05);
    padding: 4px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    flex-direction: column;
}

#tasks-list .item-card:hover .item-actions,
.kanban-card:hover .item-actions,
.task-card:hover .item-actions {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

.item-card.dragging {
    opacity: 0.6;
    transform: scale(0.95);
}

.items-list.drag-over {
    outline: 2px dashed var(--primary);
    outline-offset: 6px;
    background: rgba(102, 126, 234, 0.1);
}

.item-card.pinned-note {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.12) 0%, rgba(255, 193, 7, 0.08) 100%);
    border: 2px solid var(--warning);
    border-left: 5px solid var(--warning);
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.2);
    position: relative;
}

.item-card.pinned-note:hover {
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.25);
    transform: translateY(-3px);
}

.item-card.pinned-note::before {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 20px 20px 0;
    border-color: transparent var(--warning) transparent transparent;
    z-index: 1;
}

.pinned-icon {
    color: var(--warning);
    margin-right: 8px;
    animation: pulse-pin 2s infinite;
    filter: drop-shadow(0 1px 2px rgba(255, 193, 7, 0.5));
}

.item-title .pinned-icon {
    vertical-align: middle;
    margin-top: -2px;
}

@keyframes pulse-pin {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

[data-theme="dark"] .item-card.pinned-note {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.08) 100%);
    border-color: var(--warning);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.2);
}

[data-theme="dark"] .item-card.pinned-note:hover {
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.3);
}

[data-theme="dark"] .pinned-icon {
    color: #fbbf24;
    filter: drop-shadow(0 1px 2px rgba(251, 191, 36, 0.6));
}

[data-theme="dark"] .btn-warning {
    background: #fbbf24;
    color: #1f2937;
}

[data-theme="dark"] .btn-warning:hover { background: #f59e0b; }

[data-theme="dark"] header h1 { color: var(--primary); }

[data-theme="dark"] .global-search .search-input {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text-primary);
}

[data-theme="dark"] .global-search .search-input::placeholder { color: var(--text-secondary); }

.section-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.form-group input:invalid,
.form-group textarea:invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: modalBackdropFadeIn 0.3s ease;
}

@keyframes modalBackdropFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(to bottom, var(--bg-card) 0%, rgba(99, 102, 241, 0.02) 100%);
    margin: 5% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 520px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    animation: modalFadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 85vh;
    overflow: hidden;
    color: var(--text-primary);
    border: 1px solid var(--border);
    position: relative;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 16px 16px 0 0;
}

@keyframes modalFadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-30px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.03) 100%);
    backdrop-filter: blur(10px);
}

.modal-header h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close {
    color: var(--text-secondary);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    line-height: 1;
}

.close:hover { 
    color: var(--text-primary);
    background: var(--bg-hover);
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(85vh - 140px);
}

/* Стили для форм в модальных окнах */
#task-form,
#password-form,
#note-form {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(85vh - 140px);
}

.form-group { margin-bottom: 14px; }

.form-group label {
    display: block;
    margin-bottom: 4px;
    color: var(--dark);
    font-weight: 500;
    font-size: 0.85rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: var(--transition);
}

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

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    max-height: 200px;
}

.form-group select {
    border-radius: 5px;
    background: var(--bg-card);
    font-size: 1rem;
}

.form-actions {
    padding: 18px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: linear-gradient(to top, var(--bg-card) 0%, rgba(99, 102, 241, 0.02) 100%);
    backdrop-filter: blur(10px);
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    font-weight: 500;
    z-index: 1001;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.notification.success { background: var(--success); }
.notification.error { background: var(--danger); }
.notification.info { background: var(--info); }

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

.empty-state h3 {
    margin-bottom: 10px;
    color: var(--dark);
}

.empty-state p { margin-bottom: 20px; }

.tasks-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.filter-btn:hover {
    background: var(--light);
    border-color: var(--primary);
}

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

.task-card { position: relative; padding-left: 50px; }

.task-priority-icon {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 1.2rem;
    z-index: 2;
}

.task-priority-low { color: #28a745; }
.task-priority-medium { color: #ffc107; }
.task-priority-high { color: #fd7e14; }
.task-priority-urgent { color: #dc3545; }

.task-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.task-status.completed {
    background: #d4edda;
    color: #155724;
}

.task-status.pending {
    background: #f8d7da;
    color: #721c24;
}

.task-assignee {
    display: inline-block;
    padding: 2px 8px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    font-size: 0.8rem;
    margin-right: 10px;
}

.task-deadline {
    font-size: 0.85rem;
    color: var(--gray);
    margin-top: 8px;
}

.task-deadline.overdue {
    color: var(--danger);
    font-weight: 500;
}

.note-view-content { padding: 20px 30px; }

.note-view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.note-view-header h4 {
    margin: 0;
    color: var(--dark);
    font-size: 1.3rem;
    flex: 1;
    margin-right: 15px;
}

.note-view-actions { display: flex; gap: 8px; }

.note-view-body { line-height: 1.6; }

.note-view-body pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    margin: 0;
    color: var(--dark);
    font-size: 1rem;
}

.notes-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.notes-column {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    background: linear-gradient(to bottom, var(--bg-card) 0%, rgba(99, 102, 241, 0.02) 100%);
}

.notes-column:nth-child(1) {
    border-top: 3px solid rgba(99, 102, 241, 0.4);
}

.notes-column:nth-child(2) {
    border-top: 3px solid rgba(139, 92, 246, 0.4);
}

.notes-column:nth-child(3) {
    border-top: 3px solid rgba(59, 130, 246, 0.4);
}

.notes-column:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.3);
}

.column-header {
    background: linear-gradient(135deg, var(--primary) 0%, rgba(99, 102, 241, 0.9) 100%);
    color: white;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.notes-column:nth-child(1) .column-header {
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
}

.notes-column:nth-child(2) .column-header {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
}

.notes-column:nth-child(3) .column-header {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
}

.column-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.notes-count {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.column-content {
    padding: 12px;
    min-height: 150px;
    max-height: 450px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    background: rgba(0, 0, 0, 0.02);
}

/* Компактные карточки заметок */
.column-content .item-card {
    margin-bottom: 0 !important;
    padding: 12px;
    border-radius: 8px;
}

.column-content .item-title {
    font-size: 0.9rem;
    margin-top: 0;
    margin-bottom: 8px;
    padding-bottom: 6px;
    font-weight: 600;
}

.column-content .item-content {
    font-size: 0.8rem;
    margin-top: 6px;
    margin-bottom: 10px;
    line-height: 1.5;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.column-content .note-author {
    font-size: 0.75rem;
    padding-top: 8px;
    margin-top: auto;
    border-top-width: 1px;
}

.column-content .item-actions {
    top: 0px;
    right: 12px;
    gap: 4px;
}

.column-content::-webkit-scrollbar {
    width: 6px;
}

.column-content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

.column-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
    transition: background 0.2s;
}

.column-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.empty-column {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem 1.5rem;
    font-style: italic;
    opacity: 0.6;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

.note-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: auto;
    margin-bottom: 0;
    padding-top: 14px;
    border-top: 2px solid var(--border);
    opacity: 0.7;
    font-weight: 500;
}

.category-badge {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Стили для карточек с category-badge-top (добавляется через JS) */
.item-card.has-category-badge {
    padding-top: 36px;
}

.item-card.has-category-badge .item-title {
    margin-top: 30px;
}

.dashboard-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.dashboard-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    min-width: 0;
}

.mini-chat {
    background: var(--bg-widget, var(--bg-card));
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    width: 320px;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}

[data-theme="dark"] .mini-chat {
    border: 1px solid rgba(139, 92, 246, 0.25);
}

.chat-header {
    background: var(--primary);
    color: white;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
}

.chat-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.chat-toggle {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.chat-toggle:hover { background: rgba(255, 255, 255, 0.1); }

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-clear-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s;
    opacity: 0.8;
}

.chat-clear-btn:hover {
    background: rgba(255, 0, 0, 0.2);
    opacity: 1;
}

.message-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.message-delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.125rem;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0;
    font-size: 0.75rem;
}

.chat-message:hover .message-delete-btn { opacity: 1; }

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

.chat-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 400px;
}

.chat-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background: var(--bg-card);
}

.chat-message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--light);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.message-user {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-vanya { color: var(--success); }
.user-artem { color: var(--info); }

.message-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.message-content {
    font-size: 0.875rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-input-area {
    padding: 10px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

.chat-user-select { margin-bottom: 0.5rem; }

.chat-user-select select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.chat-input-wrapper { display: flex; gap: 0.5rem; }

.chat-input-wrapper input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.chat-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.25);
}

.chat-send-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.chat-empty, .chat-error {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem 1rem;
    font-style: italic;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.chat-error { color: var(--danger); }

.mobile-chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    border: none;
}

.mobile-chat-button:hover {
    background: var(--secondary);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.6);
}

.mobile-chat-button:active { transform: scale(0.95); }

.chat-notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 12px;
    height: 12px;
    background: var(--danger);
    border-radius: 50%;
    color: white;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.mobile-chat-modal-content {
    height: 80vh !important;
    max-height: 80vh !important;
    width: 95% !important;
    margin: 10vh auto !important;
    display: flex;
    flex-direction: column;
}

.mobile-chat-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
}

.mobile-chat-wrapper .chat-messages {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: none;
    height: auto;
}

.app-layout {
    display: flex;
    background: var(--bg-body);
    position: relative;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    min-width: 220px;
    background: var(--bg-sidebar, var(--bg-card));
    border-right: 2px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
    left: 0;
    top: 0;
}

.sidebar.collapsed {
    width: 60px;
    min-width: 60px;
}

.sidebar-header {
    padding: 16px 14px;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-sidebar, var(--bg-card));
}

[data-theme="dark"] .sidebar-header {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.1) 0%, transparent 100%);
    border-bottom-color: rgba(139, 92, 246, 0.3);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 26px;
    height: 26px;
    color: var(--primary);
}

.logo h2 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.sidebar-close-mobile {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
}

.sidebar-close-mobile:hover {
    background: var(--bg-hover);
    border-color: var(--danger);
    color: var(--danger);
}

.sidebar-close-mobile:active {
    transform: scale(0.95);
    background: var(--danger);
    color: white;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    width: 100%;
    font-family: inherit;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.nav-item.active:hover {
    background: linear-gradient(135deg, #5048E5 0%, #7C3AED 100%);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-text { flex: 1; }

.sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: 220px;
    transition: var(--transition);
    min-height: 100vh;
}

.sidebar.collapsed + .main-content { margin-left: 60px; }

.top-header {
    background: var(--bg-header, var(--bg-card));
    border-bottom: 2px solid var(--border);
    padding: 17px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left h1 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.02em;
}

.header-center {
    flex: 1;
    max-width: 400px;
}

.header-center .global-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 8px 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.header-center .global-search::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50px;
    padding: 2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.header-center .global-search:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
}

.header-center .global-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2), 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: var(--bg-card);
    transform: translateY(-2px);
}

.header-center .global-search:focus-within::before { opacity: 1; }

.search-icon {
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.header-center .global-search:focus-within .search-icon { transform: scale(1.1); }

.header-center .search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.header-center .search-input::placeholder { color: var(--text-secondary); }

.header-center #clear-search {
    padding: 6px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.header-center #clear-search:hover {
    background: var(--bg-hover);
    color: var(--primary);
    transform: rotate(90deg);
}

.header-center #clear-search:active {
    transform: rotate(90deg) scale(0.9);
}

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

.mobile-sidebar-toggle {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    box-shadow: var(--shadow-card);
}

.mobile-sidebar-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.05);
}

.mobile-sidebar-toggle:active { transform: scale(0.95); }

.header-left { display: flex; align-items: center; }

.content-wrapper {
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
}

.container { display: none !important; }

.nav-tabs { display: none !important; }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar.collapsed .nav-text,
.sidebar.collapsed .logo h2 {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed .nav-item {
    padding: 12px;
    justify-content: center;
}

.sidebar.collapsed .logo { justify-content: center; }

.sidebar.collapsed .sidebar-toggle { margin: 0 auto; }

.app-layout .container { display: none !important; }

.app-layout header:not(.top-header) { display: none !important; }

.app-layout .nav-tabs { display: none !important; }

@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    .item-card { min-height: 60px; }
    .tab-btn { min-height: 44px; }
    .search-input, .filter-select {
        min-height: 44px;
        font-size: 16px;
    }
    input[type="password"], input[type="text"], input[type="email"], input[type="url"], textarea {
        font-size: 16px;
        min-height: 44px;
    }
}

@media (max-width: 1024px) {
    .items-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sidebar {
        width: 240px !important;
        min-width: 240px !important;
        transform: translateX(-100%) !important;
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        height: 100vh !important;
        z-index: 1001 !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease !important;
        border-radius: 0 16px 16px 0 !important;
        overflow: hidden !important;
        visibility: visible !important;
        display: flex !important;
    }
    .sidebar.mobile-open {
        transform: translateX(0) !important;
        box-shadow: 20px 0 60px rgba(0, 0, 0, 0.3), 0 0 120px rgba(99, 102, 241, 0.1);
        animation: slideInLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        visibility: visible !important;
        opacity: 1 !important;
    }
    @keyframes slideInLeft {
        from { transform: translateX(-100%); opacity: 0.8; }
        to { transform: translateX(0); opacity: 1; }
    }
    .main-content { margin-left: 0 !important; }
    .sidebar-toggle { display: none !important; }
    .sidebar-close-mobile {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    .mobile-sidebar-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    .sidebar-overlay {
        display: block !important;
        background: linear-gradient(to right, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.2));
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    .sidebar-overlay.active {
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        animation: fadeIn 0.3s ease;
    }
    @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
    .sidebar.collapsed {
        width: 240px !important;
        min-width: 240px !important;
        transform: translateX(-100%) !important;
    }
    .sidebar.collapsed.mobile-open { transform: translateX(0) !important; }
}

@media (max-width: 992px) {
    .notes-columns { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 0.75rem;
    }
    .column-content {
        gap: 8px;
        padding: 10px;
    }
}

@media (max-width: 768px) {
    .container { padding: 10px; }
    header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    header h1 {
        font-size: 1.8rem;
        text-align: center;
    }
    .global-search {
        order: -1;
        max-width: none;
    }
    .header-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    .nav-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .tab-btn {
        white-space: nowrap;
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .search-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .filter-select { width: 100%; }
    .item-card { padding: 15px; }
    .item-actions {
        position: relative;
        top: auto;
        right: auto;
        display: flex;
        margin-top: 12px;
        justify-content: center;
        gap: 8px;
        z-index: 1;
    }
    .btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    .modal-content {
        margin: 5px;
        width: calc(100% - 10px);
        max-width: none;
        max-height: 95vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    #note-view-modal .modal-content {
        margin: 0;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        animation: none;
    }
    .note-view-content {
        height: calc(100vh - 80px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .note-view-body {
        max-height: calc(100vh - 150px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 1rem;
    }
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    .password-input-group {
        flex-direction: column;
        gap: 8px;
    }
    .shortcuts-section { margin-bottom: 20px; }
    .shortcut-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .shortcut-item kbd { align-self: flex-end; }
    .kanban-board {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .kanban-column { padding: 12px; }
    .view-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .view-toggle { justify-content: center; }
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .stats-grid { grid-template-columns: 1fr; }
    .quick-actions { grid-template-columns: 1fr; }
    .quick-action-btn {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
    }
    header h1 { font-size: 2rem; }
    .nav-tabs { flex-direction: column; }
    .tab-btn { border-bottom: 1px solid var(--border); }
    .tab-btn:last-child { border-bottom: none; }
    .tab-content { padding: 20px; }
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    .form-actions .btn { width: 100%; }
    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }
    .item-card {
        padding-right: 40px;
        padding-top: 80px;
    }
    .section-actions {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .item-title {
        white-space: normal;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
    .item-content {
        -webkit-line-clamp: 4;
        line-clamp: 4;
    }
    .top-header {
        padding: 12px 16px;
        gap: 12px;
        position: sticky;
        top: 0;
        z-index: 99;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        background: rgba(255, 255, 255, 0.9);
    }
    [data-theme="dark"] .top-header { background: rgba(20, 25, 40, 0.95); }
    .mobile-sidebar-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 100;
    }
    [data-theme="dark"] .mobile-sidebar-toggle {
        border-color: var(--border);
        background: var(--bg-card);
        color: var(--text-primary);
    }
    .header-left {
        flex: 1;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .header-left h1 {
        font-size: 1.25rem;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .header-center {
        flex: 0 0 auto;
        width: auto;
        max-width: none;
        order: 3;
    }
    .header-right {
        order: 2;
        flex: 0 0 auto;
    }
    .header-center .global-search {
        padding: 0;
        background: transparent;
        border: none;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        position: relative;
        overflow: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .header-center .global-search.active {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        width: calc(100vw - 32px);
        max-width: 400px;
        border-radius: 32px;
        padding: 10px 16px;
        background: var(--bg-card);
        border: 1px solid var(--primary);
        box-shadow: 0 4px 20px rgba(99, 102, 241, 0.2);
        z-index: 100;
    }
    .header-center .search-input {
        display: none;
        width: calc(100% - 50px);
    }
    .header-center .global-search.active .search-input { display: block; }
    .header-center .search-icon {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 20px;
        height: 20px;
        cursor: pointer;
        color: var(--text-secondary);
        transition: all 0.3s ease;
    }
    .header-center .global-search.active .search-icon {
        left: 16px;
        transform: translateY(-50%);
    }
    .header-center #clear-search {
        display: none;
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        width: 32px;
        height: 32px;
        padding: 0;
        background: var(--bg-hover);
        border: none;
    }
    .header-center .global-search.active #clear-search {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .content-wrapper { padding: 16px; }
    .dashboard-layout {
        flex-direction: column;
        gap: 20px;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        width: 100%;
    }
    .mini-chat {
        width: 100%;
        position: static;
        max-height: 400px;
    }
    .dashboard-widget { border-radius: 12px; }
    .widget-header { padding: 12px 16px; }
    .widget-content { padding: 12px 16px; }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: 10px;
    }
    .stat-item {
        padding: 12px 8px;
        background: var(--bg-card);
        border-radius: 12px;
        border: 1px solid var(--border);
    }
    .stat-number {
        font-size: 1.5rem;
        margin-bottom: 2px;
    }
    .stat-label {
        font-size: 0.75rem;
        line-height: 1.2;
    }
    .items-list {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0;
    }
    .item-card {
        padding: 16px;
        border-radius: 16px;
        margin-bottom: 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        border: 1px solid var(--border);
        transition: all 0.2s ease;
        position: relative;
        overflow: visible;
    }
    .item-card:active {
        transform: scale(0.98);
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    }
    .item-actions {
        position: absolute;
        bottom: 16px;
        right: 16px;
        display: flex;
        opacity: 1;
        gap: 8px;
        background: var(--bg-card);
        padding: 4px;
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
        border: 1px solid var(--border);
    }
    .item-actions .btn-icon {
        width: 40px;
        height: 40px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        background: var(--bg-hover);
        border: none;
        transition: all 0.2s ease;
    }
    .item-actions .btn-icon:active {
        transform: scale(0.9);
        background: var(--primary);
        color: white;
    }
    .item-card .item-title {
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 8px;
        padding-right: 120px;
    }
    .item-card .item-meta {
        font-size: 0.875rem;
        color: var(--text-secondary);
        margin-bottom: 4px;
    }
    .item-card .item-content {
        font-size: 0.875rem;
        line-height: 1.5;
        color: var(--text-secondary);
        margin-top: 8px;
        padding-right: 40px;
    }
    .modal { padding: 0; }
    .modal-content {
        margin: 0;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        animation: slideUpMobile 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    @keyframes slideUpMobile {
        from { transform: translateY(100%); opacity: 0.8; }
        to { transform: translateY(0); opacity: 1; }
    }
    .modal-header {
        padding: 16px 20px;
        position: sticky;
        top: 0;
        z-index: 10;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 60px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }
    .modal-header h3 {
        font-size: 1.25rem;
        font-weight: 700;
        margin: 0;
        padding-right: 16px;
    }
    .modal-header .close {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--bg-hover);
        border-radius: 50%;
        font-size: 1.5rem;
        line-height: 1;
        transition: all 0.2s ease;
    }
    .modal-header .close:active {
        transform: scale(0.9);
        background: var(--danger);
        color: white;
    }
    .modal-body {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 20px;
        padding-bottom: 100px;
    }
    .form-actions {
        padding: 16px 20px;
        gap: 12px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-top: 1px solid var(--border);
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        z-index: 11;
    }
    .form-actions .btn {
        flex: 1;
        min-height: 48px;
        font-size: 1rem;
        font-weight: 600;
        border-radius: 12px;
    }
    .search-filters {
        flex-direction: column;
        gap: 12px;
    }
    .search-input {
        font-size: 16px;
        padding: 14px 16px;
        border-radius: 12px;
        border: 1px solid var(--border);
        background: var(--bg-card);
        transition: all 0.2s ease;
    }
    .search-input:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }
    .section-header {
        flex-direction: column;
        gap: 16px;
        padding: 0;
        margin-bottom: 20px;
    }
    .section-header h2 {
        font-size: 1.5rem;
        margin: 0;
    }
    .section-actions {
        width: 100%;
        flex-direction: column;
        gap: 12px;
    }
    .section-actions .btn {
        width: 100%;
        justify-content: center;
    }
    .btn {
        min-height: 48px;
        padding: 12px 20px;
        font-size: 0.9rem;
        border-radius: 12px;
        font-weight: 600;
    }
    .btn-small {
        min-height: 40px;
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    .nav-item {
        padding: 16px;
        font-size: 0.9rem;
        border-radius: 12px;
        min-height: 48px;
    }
    .nav-icon {
        width: 22px;
        height: 22px;
    }
    .sidebar,
    .modal-content,
    .item-card,
    .btn,
    .nav-item {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        will-change: transform;
    }
    @media (hover: none) {
        .item-card:hover,
        .btn:hover,
        .nav-item:hover {
            transform: none;
            box-shadow: none;
        }
    }
    .content-wrapper,
    .modal-body,
    .chat-messages,
    .items-list {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    a, button, .btn, .nav-item {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
}

@media (max-width: 600px) {
    .items-list { grid-template-columns: repeat(1, minmax(0, 1fr)); }
}

@media (max-width: 576px) {
    .notes-columns { 
        grid-template-columns: 1fr; 
        gap: 0.75rem;
        margin-top: 0.75rem;
    }
    .column-content {
        padding: 10px;
        gap: 8px;
    }
    .column-content .item-card {
        padding: 10px;
    }
    .dashboard-layout { gap: 1rem; }
    .mini-chat { max-height: 300px; }
    .chat-messages { max-height: 350px !important; }
}

@media (max-width: 480px) {
    .top-header {
        padding: 10px 12px;
        gap: 8px;
        min-height: 56px;
    }
    .header-left {
        flex: 1;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .header-left h1 {
        font-size: 1.125rem;
        margin: 0;
        font-weight: 700;
        letter-spacing: -0.02em;
    }
    .mobile-sidebar-toggle {
        width: 40px;
        height: 40px;
        padding: 8px;
        margin-right: 0;
        background: transparent;
        border: none;
        color: var(--text-primary);
    }
    .header-center .global-search {
        width: 36px;
        height: 36px;
    }
    .header-center .global-search.active {
        width: calc(100vw - 24px);
        max-width: none;
    }
    .theme-toggle {
        width: 36px;
        height: 36px;
        padding: 8px;
    }
    .content-wrapper { padding: 12px; }
    .mini-chat { max-height: 350px; }
    .chat-messages { max-height: 200px; }
    .item-card {
        padding: 12px;
        border-radius: 8px;
    }
    .item-title {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    .item-meta, .item-content { font-size: 0.8rem; }
    .btn {
        min-height: 48px;
        padding: 12px 20px;
        font-size: 0.9rem;
        border-radius: 12px;
        font-weight: 600;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        user-select: none;
    }
    .btn:active { transform: scale(0.98); }
    .btn-small {
        min-height: 40px;
        padding: 8px 12px;
        font-size: 0.85rem;
        border-radius: 10px;
    }
    .btn-icon {
        width: 44px;
        height: 44px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
    }
    .nav-item {
        padding: 16px;
        font-size: 0.9rem;
        min-height: 48px;
        margin-bottom: 4px;
        -webkit-tap-highlight-color: transparent;
    }
    .nav-item:active {
        transform: scale(0.98);
        background: var(--bg-hover);
    }
    .sidebar-header {
        padding: 20px 16px;
        border-bottom: 2px solid var(--border);
    }
    .logo h2 { font-size: 1.25rem; }
    .sidebar-footer .nav-item { margin-bottom: 0; }
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px;
        padding: 14px 16px;
        border-radius: 12px;
        border: 2px solid var(--border);
        background: var(--bg-card);
        transition: all 0.2s ease;
        -webkit-appearance: none;
        appearance: none;
    }
    .form-group input:focus,
    .form-group textarea:focus,
    .form-group select:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
        outline: none;
    }
    .form-group label {
        font-size: 0.875rem;
        font-weight: 600;
        margin-bottom: 8px;
        color: var(--text-primary);
    }
    .modal-header h3 {
        font-size: 1.125rem;
        line-height: 1.2;
    }
    .quick-actions {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .quick-action-btn {
        padding: 16px 12px;
        font-size: 0.85rem;
        border-radius: 12px;
        min-height: 64px;
        flex-direction: column;
        gap: 8px;
    }
    .quick-action-btn .icon-small {
        width: 24px;
        height: 24px;
    }
    .password-display {
        font-size: 1rem;
        padding: 16px;
        border-radius: 12px;
        word-break: break-all;
    }
    .password-options label {
        padding: 12px;
        font-size: 0.9rem;
    }
    .filter-btn {
        padding: 10px 16px;
        font-size: 0.875rem;
        border-radius: 20px;
        min-height: 40px;
        white-space: nowrap;
    }
    .widget-header { padding: 12px; }
    .widget-content { padding: 12px; }
    .widget-header h3 { font-size: 1rem; }
    .stat-number { font-size: 1.5rem; }
    .stat-label { font-size: 0.8rem; }
    .item-card {
        padding: 14px;
        border-radius: 14px;
    }
    .item-card .item-title {
        font-size: 1rem;
        padding-right: 100px;
    }
    .item-card .item-meta { font-size: 0.8rem; }
    .item-card .item-content {
        font-size: 0.8rem;
        margin-top: 6px;
    }
    .item-actions {
        bottom: 12px;
        right: 12px;
        padding: 3px;
        gap: 6px;
    }
    .item-actions .btn-icon {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }
    .dashboard-layout { gap: 16px; }
    .dashboard-grid { gap: 12px; }
    .dashboard-widget { border-radius: 14px; }
    .notification {
        top: 70px;
        right: 12px;
        left: 12px;
        padding: 12px 16px;
        font-size: 0.875rem;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }
    .tab-swipe-hint {
        font-size: 0.8rem;
        padding: 8px 16px;
        bottom: 20px;
        border-radius: 20px;
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}

@media (min-width: 1201px) {
    .mobile-chat-button { display: none !important; }
}

@media (max-width: 1200px) {
    .dashboard-layout { 
        flex-direction: column; 
        gap: 24px; 
    }
    .dashboard-grid {
        width: 100%;
    }
    .mini-chat {
        width: 100%;
        position: static;
        max-height: 400px;
    }
    .mobile-chat-button { display: flex; }
    .mobile-chat-modal-open .mobile-chat-button { display: none; }
}