* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fbf7f0;
    color: #2e2e2e;
    overflow: hidden;
    height: 100vh;
    touch-action: pan-x;
    user-select: none;
}
#app {
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Шапка */
.header {
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid #e0d9cc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}
.date-display {
    font-size: 1.2rem;
    font-weight: 600;
}
.context-switcher {
    display: flex;
    gap: 6px;
}
.ctx-btn {
    background: #f0ebe0;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
    color: #5c5c5c;
}
.ctx-btn.active {
    background: #d4a373;
    color: white;
}

/* Лента дней */
.daily-track {
    flex: 1;
    display: flex;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    padding: 0;
}
.day-page {
    flex: 0 0 100vw;
    scroll-snap-align: center;
    padding: 20px;
    overflow-y: auto;
    max-height: 100%;
    border-right: 1px solid #e0d9cc;
}
.day-header {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: #8b7e6a;
    border-bottom: 1px dashed #d4c9b5;
    padding-bottom: 6px;
}
.active-tasks, .other-tasks {
    list-style: none;
    margin-bottom: 20px;
}
.active-tasks li, .other-tasks li {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0ebe0;
}
.other-tasks {
    opacity: 0.6;
    pointer-events: none;
}
.task-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #d4a373;
    border-radius: 50%;
    margin-right: 12px;
    display: inline-block;
    cursor: pointer;
    flex-shrink: 0;
}
.task-checkbox.checked {
    background: #d4a373;
    border-color: #d4a373;
    position: relative;
}
.task-checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 14px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.task-text {
    flex: 1;
    font-size: 1rem;
}
.task-text.completed {
    text-decoration: line-through;
    color: #a69b8c;
}
.task-edit {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #b7a590;
    cursor: pointer;
    padding: 4px;
}

/* Кнопки добавления и проектов */
.fab {
    position: fixed;
    bottom: 24px;
    width: 56px;
    height: 56px;
    background: #d4a373;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
}
#addTaskBtn {
    right: 24px;
}
#projectsBtn {
    left: 24px;
    right: auto;
}

/* Кнопка СКЛАД ИДЕЙ */
.inbox-handle-btn {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: #d4a373;
    color: white;
    border: none;
    border-radius: 30px;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 1px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
    cursor: pointer;
    z-index: 20;
    transition: 0.2s;
}
.inbox-handle-btn:active {
    background: #b98b5a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Панель "Когда-нибудь" */
.inbox-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70vh;
    background: #f5f0e8;
    border-top: 2px solid #d4a373;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 30;
    display: flex;
    flex-direction: column;
}
.inbox-panel.open {
    transform: translateY(0);
}
.inbox-header {
    padding: 16px;
    background: #fff;
    border-bottom: 1px solid #e0d9cc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.inbox-filter {
    display: flex;
    gap: 6px;
}
.inbox-close {
    background: none;
    border: none;
    font-size: 1rem;
    color: #d4a373;
    cursor: pointer;
}
.inbox-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}
.inbox-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e0d9cc;
    cursor: pointer;
}
.inbox-item .item-type {
    margin-right: 12px;
    font-size: 1.3rem;
}
.inbox-item .item-text {
    flex: 1;
}

/* Модальные окна */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
}
.modal-overlay.active {
    display: flex;
}
.modal {
    width: 90%;
    max-width: 400px;
    background: white;
    border-radius: 16px;
    padding: 20px;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}
.modal-body {
    margin-bottom: 20px;
    max-height: 60vh;
    overflow-y: auto;
}
.modal-body label {
    display: block;
    margin: 10px 0 4px;
    font-size: 0.9rem;
    color: #8b7e6a;
}
.modal-body input, .modal-body select, .modal-body textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #d4c9b5;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 6px;
}
.modal-context {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.modal-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    font-size: 1rem;
    cursor: pointer;
}
.btn-primary {
    background: #d4a373;
    color: white;
}
.btn-secondary {
    background: #e0d9cc;
    color: #5c5c5c;
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #8b7e6a;
}

/* Стили для модального окна проектов */
#projectsModal .modal-body {
    max-height: 50vh;
    overflow-y: auto;
}
#projectsList .task-edit {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    color: #b7a590;
}
#projectDeleteBtn {
    background: #e0d9cc;
    color: #5c5c5c;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
}

/* Список проектов */
.project-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #e0d9cc;
    justify-content: space-between;
}
.project-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}
.project-name {
    font-weight: 600;
    flex-shrink: 0;
    min-width: 80px;
}
.project-desc {
    flex: 1;
    font-size: 0.85rem;
    color: #8b7e6a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: auto;
}
.project-edit,
.project-delete {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: #8b7e6a;
    padding: 4px;
    flex-shrink: 0;
}
.project-edit:hover,
.project-delete:hover {
    color: #b22222;
}

/* Теги проектов */
.project-tag {
    display: inline-block;
    white-space: nowrap;
}

/* Палитра цветов */
.color-picker {
    display: flex;
    gap: 8px;
    margin: 10px 0;
}
.color-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}
.color-circle.selected {
    border-color: #333;
}

/* Адаптивность */
@media (max-width: 600px) {
    .fab {
        width: 52px;
        height: 52px;
        font-size: 24px;
    }
    .modal {
        max-width: 90%;
        padding: 15px;
    }
}
.project-actions {
    margin-left: auto;
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}