.todo-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 16px;
}

.todo-page-header {
    margin-bottom: 24px;
}

.todo-page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
}

/* フィルター */
.todo-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.todo-filter-btn {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    color: #555;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
    cursor: pointer;
}

.todo-filter-btn:hover {
    background: #e5e7eb;
    color: #333;
}

.todo-filter-btn.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

/* 作成フォーム */
.todo-create-form {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.todo-form-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.todo-form-row:last-child {
    margin-bottom: 0;
}

.todo-input-title {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.todo-input-title:focus {
    border-color: #3b82f6;
}

.todo-select-priority,
.todo-input-date {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.85rem;
    outline: none;
    background: #fff;
}

.todo-input-desc {
    flex: 1;
    min-width: 200px;
    padding: 8px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.85rem;
    outline: none;
    resize: vertical;
}

.todo-input-desc:focus,
.todo-select-priority:focus,
.todo-input-date:focus {
    border-color: #3b82f6;
}

.todo-btn-add {
    padding: 10px 20px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.todo-btn-add:hover {
    background: #2563eb;
}

.todo-errors {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 4px;
}

/* Todo一覧 */
.todo-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.todo-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    transition: box-shadow 0.2s;
}

.todo-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

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

.todo-item.todo-done .todo-item-title {
    text-decoration: line-through;
    color: #9ca3af;
}

.todo-item-left {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.todo-checkbox {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: transparent;
    transition: all 0.2s;
    padding: 0;
    margin-top: 2px;
}

.todo-checkbox:hover {
    border-color: #3b82f6;
}

.todo-checkbox.checked {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}

.todo-item-content {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.todo-item-content:hover .todo-item-title {
    color: #3b82f6;
}

.todo-item-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
    word-break: break-word;
    transition: color 0.15s;
}

.todo-item-desc {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 6px;
    white-space: pre-wrap;
    word-break: break-word;
}

.todo-item-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.78rem;
}

.todo-badge-status,
.todo-badge-priority {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
}

.todo-due {
    color: #6b7280;
}

.todo-overdue {
    color: #ef4444;
    font-weight: 600;
}

.todo-date {
    color: #9ca3af;
}

/* 空状態 */
.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: #6b7280;
}

/* ========== モーダル ========== */
.todo-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: todoFadeIn 0.15s ease;
}

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

.todo-modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: todoSlideUp 0.2s ease;
}

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

.todo-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.todo-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a1a;
}

.todo-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}

.todo-modal-close:hover {
    color: #374151;
}

.todo-modal-body {
    padding: 20px 24px;
}

.todo-modal-field {
    margin-bottom: 16px;
    flex: 1;
    min-width: 0;
}

.todo-modal-field:last-child {
    margin-bottom: 0;
}

.todo-modal-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.todo-modal-field .todo-input-title,
.todo-modal-field .todo-input-desc,
.todo-modal-field .todo-select-priority,
.todo-modal-field .todo-input-date {
    width: 100%;
    box-sizing: border-box;
}

.todo-modal-row {
    display: flex;
    gap: 12px;
}

.todo-modal-meta {
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
    margin-top: 8px;
}

.todo-modal-meta .todo-date {
    font-size: 0.78rem;
}

.todo-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px 20px;
    border-top: 1px solid #f3f4f6;
}

.todo-modal-footer-right {
    display: flex;
    gap: 8px;
}

.todo-btn-save {
    padding: 8px 20px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.todo-btn-save:hover {
    background: #2563eb;
}

.todo-btn-cancel {
    padding: 8px 16px;
    background: #f3f4f6;
    color: #555;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.todo-btn-cancel:hover {
    background: #e5e7eb;
}

.todo-btn-delete-modal {
    padding: 8px 16px;
    background: none;
    color: #ef4444;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.todo-btn-delete-modal:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

/* レスポンシブ */
@media (max-width: 600px) {
    .todo-page {
        padding: 16px 12px;
    }

    .todo-form-row {
        flex-direction: column;
    }

    .todo-input-title,
    .todo-input-desc,
    .todo-select-priority,
    .todo-input-date,
    .todo-btn-add {
        width: 100%;
    }

    .todo-item-meta {
        font-size: 0.72rem;
    }

    .todo-modal {
        max-width: 100%;
        border-radius: 12px;
    }

    .todo-modal-row {
        flex-direction: column;
        gap: 0;
    }

    .todo-modal-header {
        padding: 16px 16px 0;
    }

    .todo-modal-body {
        padding: 16px;
    }

    .todo-modal-footer {
        padding: 12px 16px 16px;
        flex-direction: column-reverse;
        gap: 10px;
    }

    .todo-modal-footer-right {
        width: 100%;
    }

    .todo-modal-footer-right .todo-btn-save,
    .todo-modal-footer-right .todo-btn-cancel {
        flex: 1;
    }

    .todo-btn-delete-modal {
        width: 100%;
    }
}
