:root {
    --bg: #191919;
    --surface: #242424;
    --surface-hover: #2d2d2d;
    --text: #f1f1f1;
    --text-secondary: #9e9e9e;
    --accent: #4a86ff;
    --border: #333333;
    --radius: 10px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body.light {
    --bg: #f7f7f5;
    --surface: #ffffff;
    --surface-hover: #f0f0ee;
    --text: #1a1a1a;
    --text-secondary: #6b6b6b;
    --border: #e6e6e4;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
    transition: background 0.3s, color 0.3s;
}

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Вкладки */
.tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 12px 12px 0;
    border-bottom: 1px solid var(--border);
}

.tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-family: var(--font);
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.tab.active {
    color: var(--text);
    font-weight: 600;
    box-shadow: inset 0 -2px 0 var(--accent);
}

.tab svg {
    flex-shrink: 0;
}

/* Тема */
.theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    margin-left: auto;
    transition: all 0.2s;
}

.theme-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
}

/* Контент */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Пустое */
.empty {
    text-align: center;
    color: var(--text-secondary);
    padding-top: 80px;
    opacity: 0.6;
    font-size: 14px;
}

.empty svg {
    margin-bottom: 12px;
    opacity: 0.4;
}

/* Элемент списка заметок */
.note-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.note-item:hover {
    border-color: var(--accent);
}

.note-item .note-title {
    font-size: 14px;
    font-weight: 500;
}

.note-item .note-date {
    font-size: 11px;
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-left: 12px;
}

/* Полный просмотр заметки */
.note-full {
    padding: 4px 0;
}

.note-full-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.back-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 14px;
    font-family: var(--font);
    cursor: pointer;
    padding: 4px 0;
}

.back-btn:hover {
    opacity: 0.8;
}

.note-full h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.3;
}

.note-full-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
    margin-bottom: 16px;
}

/* Карточка заметки */
.note-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 8px;
    transition: all 0.15s;
    cursor: default;
}

.note-card:hover {
    border-color: var(--accent);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.note-card h3 {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.note-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
}

.note-date {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Удаление */
.del-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
    opacity: 0;
}

.note-card:hover .del-btn,
.todo-item:hover .del-btn {
    opacity: 0.6;
}

.del-btn:hover {
    opacity: 1 !important;
    color: #ff4444;
    background: rgba(255,68,68,0.1);
}

.del-btn.small {
    font-size: 14px;
}

/* To-Do */
.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.todo-item:hover {
    border-color: var(--accent);
}

.todo-item.done {
    opacity: 0.5;
}

.todo-item.done .todo-title {
    text-decoration: line-through;
}

.todo-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-secondary);
    border-radius: 6px;
    flex-shrink: 0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.todo-item.done .todo-checkbox {
    background: var(--accent);
    border-color: var(--accent);
}

.todo-item.done .todo-checkbox::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.todo-title {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

/* Форма */
.form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: slideUp 0.2s ease;
}

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

.input, .textarea {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font);
    resize: vertical;
    transition: border 0.2s;
}

.input:focus, .textarea:focus {
    outline: none;
    border-color: var(--accent);
}

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

.form-buttons {
    display: flex;
    gap: 8px;
}

.btn {
    flex: 1;
    padding: 11px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

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

/* Кнопка добавления */
.add-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    font-size: 26px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.add-btn:hover {
    transform: scale(1.05);
}

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

.note-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.note-item:hover {
    border-color: var(--accent);
}

.note-item .note-title {
    font-size: 14px;
    font-weight: 500;
}

.note-item .note-date {
    font-size: 11px;
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-left: 12px;
}

.note-full {
    padding: 4px 0;
}

.note-full-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.back-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 14px;
    font-family: var(--font);
    cursor: pointer;
    padding: 4px 0;
}

.back-btn:hover {
    opacity: 0.8;
}

.note-full h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.3;
}

.note-full-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
    margin-bottom: 16px;
}